Events
AbyssalLib provides a lightweight wrapper around the standard Bukkit event system. This allows you to create and register event handlers without requiring your classes to implement the standard Listener interface.
Registering an Event Handler
To listen for an event, use the @SubscribeEvent annotation on your method instead of the standard Bukkit @EventHandler.
public final class ExampleEvents {
@SubscribeEvent
public void onInventoryClick(InventoryClickEvent event) {
// Event logic here
}
}
Once your handler methods are defined, you must register the class using the EventBus inside your plugin's main class.
public final class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
EventBus bus = new EventBus(this);
bus.register(new ExampleEvents());
}
}
05 June 2026