on
inline fun <E : Event> EventListener.on(priority: Event.Priority = Event.Priority.MID, noinline block: (E) -> Unit)(source)
Registers an event listener for the specified event class.
Parameters
priority
The priority of the listener (higher priority listeners are executed first).
block
The function to execute when the event is triggered.