Summary
Both the plugins that we made in this chapter have the entire code within a single class. However, you may choose to separate these into the main plugin class and a listener class. In small plugins like these, it is not necessary. But in larger projects, it will keep your code much cleaner. There will be a few differences, such as having static variables or passing a variable to another class. In the next chapter, we will complete the MobEnhancer
plugin by adding configuration as well as a reload
command. We will have the Listener
and CommandExecutor
as a part of the main
class. Once the plugin is complete, we will go over the differences for the same plugin as three individual classes.