listen

fun <T : Event> listen(plugin: Plugin, eventClass: KClass<T>, priority: EventPriority = EventPriority.NORMAL, ignoreCancelled: Boolean = false, register: Boolean = true, onEvent: T.() -> Unit): SingleListener<T>


inline fun <T : Event> Any.listen(priority: EventPriority = EventPriority.NORMAL, ignoreCancelled: Boolean = false, register: Boolean = true, noinline onEvent: T.() -> Unit): SingleListener<T>

Parameters

T

the type of event to listen to

priority

the priority when multiple listeners handle this event

ignoreCancelled

if manual cancellation should be ignored

register

if the event should be registered immediately

onEvent

the event callback