Configurable data types
You can easily make most variables in your plugin configurable. The following table comprises various data types and examples of why you may want them to be configurable:
Data Type |
How It Can Be Used |
---|---|
|
To define the number of times an event should occur |
|
To set the health of a mob when it spawns |
|
To turn a specific feature on or off |
|
To change a message that is sent to a player |
|
To make a customized item appear |
Tip
Adding an ItemStack
value to a configuration file is complicated, but this will be explained towards the end of this chapter.
We are going to make MobEnhancer
configurable. We want to give the players a choice of setting the value of the zombies' health. This will simply be one double
value. Let's expand the plugin to support additional creature types. We will create the config
file first and then adapt the program to be able to modify different types of mobs. Therefore, we have decided that the config
file...