EventBus

interface EventBus

Manages events and event handlers.

Functions

Link copied to clipboard
abstract fun <E : Event?> fire(@NotNull event: @NotNull E): Boolean
Fires the specified event synchronously.
Link copied to clipboard
abstract fun <E : Event?> fireAsync(@NotNull event: @NotNull E): CompletableFuture<E>
Fires the specified event asynchronously.
Link copied to clipboard
abstract fun register(@NotNull addon: @NotNull Any, @NotNull listener: @NotNull Any)
Registers all methods annotated with EventSubscribe as event handlers in the specified listener with the associated addon.
abstract fun <E : Event?> register(@NotNull addon: @NotNull Any, eventClass: Class<E>, priority: EventPriority, @NotNull handler: @NotNull EventHandler<E>)
Registers an event handler with the specified priority.
Link copied to clipboard
abstract fun unregister(@NotNull addon: @NotNull Any)
Unregisters all event handlers associated with the specified addon.
abstract fun unregister(@NotNull addon: @NotNull Any, @NotNull listener: @NotNull Any)
Unregisters all methods annotated with EventSubscribe as event handlers in the specified listener with the associated addon.
abstract fun unregister(@NotNull addon: @NotNull Any, @NotNull handler: @NotNull EventHandler<out Any>)
Unregisters the specified event handler associated with the addon.