Adding a command to plugin.yml
Create a new Bukkit plugin as you did in Chapter 3, Creating your First Bukkit Plugin, but name it Enchanter
. Next we will inform Bukkit that you will be using a command by modifying the plugin.yml
file of your plugin.
As mentioned in Chapter 2, Learning the Bukkit API, Bukkit reads the YAML file in order to find out the necessary information about your plugin. This information includes all of the commands that your plugin will handle. Each command can have a description, proper usage message, and aliases (similar to how rl is an alias for reload). The command we will use for our plugin will be enchant
. It is typical to use all lowercase letters for commands so that players do not have to worry about capitalization. The following code is a sample of how our plugin.yml
will look with the enchant
command added:
name: Enchanter version: 0.1 main: com.codisimus.enchanter.Enchanter description: Used to quickly put enchantments on an item commands: enchant: ...