bukkit Event Handling

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

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:



Got any bukkit Question?