Events
Registering Events
Registering events is mostly same as it is in Bukkit however you do not have to implement Listener.
public class MyListeners {
@SubscribeEvent
public void onMove(PlayerMoveEvent e) {}
}
Afterwards in your onEnable().
public class MyPlugin implements JavaPlugin {
@Override
public void onEnable() {
EventBus bus = new EventBus(this);
bus.register(new MyListeners());
}
}
Thats it! You have registered an event successfully.
Firing events:
For firing events you need not create an instance of EventBus simply call EventBus.post(Evemt).
23 November 2025