Annotation Interface Subscribe
-
Optional Element Summary
-
Element Details
-
order
Deprecated.specify the order usingpriority()
insteadThe order events will be posted to this listener.- Returns:
- the order
- Default:
- NORMAL
-
priority
short priorityThe priority of this event handler. Priorities are used to determine the order in which event handlers are called. The higher the priority, the earlier the event handler will be called.Note that due to compatibility constraints, you must specify
PostOrder.CUSTOM
in order to use this field.- Returns:
- the priority
- Default:
- -32768
-
async
boolean asyncWhether the handler must be called asynchronously. By default, all event handlers are called asynchronously.For performance (for instance, if you use
EventTask.withContinuation(java.util.function.Consumer<com.velocitypowered.api.event.Continuation>)
), you can optionally specifyfalse
. This option will becomefalse
by default in a future release of Velocity.If this is
true
, the method is guaranteed to be executed asynchronously. Otherwise, the handler may be executed on the current thread or asynchronously. This still means you must consider thread-safety in your event listeners as the "current thread" can and will be different each time.Note that if any method handler targeting an event type is marked with
true
, then every handler targeting that event type will be executed asynchronously.- Returns:
- Requires async
- Default:
- true
-
priority()
instead