Summary
Both of the plugins that we have made in this chapter have the entire code within a single class. You may however choose to separate these into the main plugin class and a listener class. In small plugins like these it is not necessary, yet 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 part of the main class. Once the plugin is complete we will go over the differences for the same plugin as three individual classes.