on

open fun <E : T> on(eventType: Class<E>, handler: Consumer<E>)

Creates an event handler which executes Consumer for every event of eventType.