Package-level declarations

Types

Link copied to clipboard
abstract class EventCustom : Event

A custom event class that extends Event.

Link copied to clipboard

A group that holds multiple EventHandles.

Link copied to clipboard
class EventHandle(unregister: () -> Unit)

Represents a handle for an event listener, allowing for unregistration.

Link copied to clipboard

Handles event listening and registration for various events.

Link copied to clipboard
class EventScope<T : Event>(val filters: MutableList<(T) -> Boolean> = mutableListOf())

Defines a scope for filtering events based on various criteria.

Link copied to clipboard

A singleton object that manages event templates.

Link copied to clipboard

A singleton object to manage pause states for different operations identified by a key.

Functions

Link copied to clipboard
fun <T : Event> fireEvent(event: T): T

Utility function to fire an event.

Link copied to clipboard
fun group(block: EventGroup.() -> Unit): EventGroup

Creates an EventGroup and applies the provided block to configure it.

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, crossinline scope: EventScope<T>.() -> Unit = {}, noinline filter: (T) -> Boolean = { true }, noinline block: (T) -> Unit): EventHandle

Registers a listener for the specified event type T.

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

Registers a listener for the specified event type T within the context of an EventGroup.

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, crossinline scope: EventScope<T>.() -> Unit = {}, noinline filter: (T) -> Boolean = { true }, noinline block: suspend (T) -> Unit): EventHandle

Registers a suspendable listener for the specified event type T.

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

Registers a listener for the specified event type T within the context of a JavaPlugin.