After deciding which event we will listen for, it is time to start programming. Create a new project, as described in Chapter 3, Creating Your First Bukkit Plugin, and call it NoRain
. Don't forget to create a plugin.yml
file as well.
In order to listen for an event, your plugin must have a class that is registered as a Listener class
. We will only have one class, named NoRain.java
, for this project. Therefore, we will make this a Listener
class as well. The class declaration will look like the following line of code:
public class NoRain extends JavaPlugin implements Listener
Alternatively, if this is a large project, you can make a class for the Listener class
, which is similar to how the Enchanter
project had CommandExecutor
as a separate class. Also, like CommandExecutor
, a Listener class
will implement an interface method
. The interface method
that we wish to implement is org.bukkit.event.Listener
.
The class is declared as a Listener
class but it is still not...