Annotation Interface SubscribeEvent
Marks a method as an event listener for the custom EventBus system.
Methods annotated with this will be automatically registered by
EventBus#register(Object) and invoked when relevant events are posted.
The method must have exactly one parameter which extends Event.
Example:
@SubscribeEvent
public void onCustomEvent(MyCustomEvent event) {
// handle event
}
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether the event handler should be called for cancelled events.org.bukkit.event.EventPriorityDefines the priority at which the event listener should be called.
-
Element Details
-
priority
org.bukkit.event.EventPriority priorityDefines the priority at which the event listener should be called.This affects the order in which listeners receive events. Listeners with higher priority are called later.
- Returns:
- the priority for the event handler
- Default:
NORMAL
-
ignoreCancelled
boolean ignoreCancelledWhether the event handler should be called for cancelled events.- Returns:
- true to ignore cancelled events (default), false to receive them anyway
- Default:
true
-