Interface EventBus


public interface EventBus
Platform-independent event bus. Listeners are called on the server (main/region) thread, in EventPriority order; a listener throwing an exception is logged and skipped.
Subscription sub = SepareWorldItems.get().events().subscribe(GroupSwitchPreEvent.class, e -> {
    if (e.to().group().equals("minigames") && isInCombat(e.playerUuid())) e.setCancelled(true);
});
// later: sub.unsubscribe();
Subscribing to a supertype (e.g. PlayerEvent) receives every subtype.