onEvent

abstract fun <T : BEvent> onEvent(type: EventType<T>, handler: (T) -> Unit): Closeable

Registers a handler block to be executed when an event of type is dispatched