EventListener

Handles event listening and registration for various events.

This object provides methods to register event listeners with configurable options such as event priority, debounce, throttle, async execution, and more. It also manages the unregistration of events.

Functions

Link copied to clipboard
fun init(plugin: Plugin)

Initializes the event listener with the given plugin.

Link copied to clipboard
inline fun <T : Event> listen(priority: EventPriority = EventPriority.NORMAL, ignoreCancelled: Boolean = false, once: Boolean = false, delay: Long = 0, debounce: Long = 0, throttle: Long = 0, async: Boolean = false, noinline filter: (T) -> Boolean = { true }, noinline block: (T) -> Unit): EventHandle

Registers a listener for the specified event type T with various configurable options.

Link copied to clipboard
inline fun <T : Event> listenSuspend(priority: EventPriority = EventPriority.NORMAL, ignoreCancelled: Boolean = false, once: Boolean = false, delay: Long = 0, debounce: Long = 0, throttle: Long = 0, noinline filter: (T) -> Boolean = { true }, noinline block: suspend (T) -> Unit): EventHandle

Registers a suspendable listener for the specified event type T.