Event Listeners

Event listeners can be annotated with a @IocBukkitListener annotation. This will make sure the event listener will be registered with Bukkit. This takes away the need to manage this yourself.

Notice the listener also is a Tubing Bean. This means you can also inject any other dependency you want into this listener using the constructor

@IocBukkitListener
public class PlayerJoinListener implements Listener {

    @EventHandler(priority = EventPriority.NORMAL)
    public void onJoin(PlayerJoinEvent event) {
        ...
    }
}

Last updated