You could easily make most variables in your plugin configurable. The following is a table of various data types and examples of why you may want them to be configurable:
Data type |
How it may be used |
---|---|
|
Setting the health of a mob when it spawns |
|
Turning a specific feature on or off |
|
Changing a message that is sent to a player |
|
Making a customized item appear |
Tip
Adding an ItemStack
value to a configuration file is complicated, but will be explained towards the end of this chapter.
We are going to make MobEnhancer
configurable. We want to be able to set the value of the zombies' health. That would simply be one integer value. Let's expand the plugin to support additional creature types. We will create our config
file first and then adapt our program to be able to modify different types of mobs. Therefore, we have decided that our config
file will include a single integer for each type of mob. This integer will be the mob's health.