bukkitEvent Handling


Introduction

When something happens inside Bukkit, an Event is called so every plugin can decide what to do whenever something happens.

An Event is called when a player tries to play a block, when an entity despawn, when someone logs in... Plugins can listen to specific events and deal with it in many different ways, for example, sending a message to an admin when a Player logs in, via the PlayerLoginEvent.

Syntax

  • Bukkit.getPluginManager().registerEvents(Listener l, Plugin p);

Remarks

When registering an event, take a look if you're not registering it twice! Or your plugin will act twice for the registered event.

Take an extra look for how to handle specific events: