on

abstract fun <E> on(type: Class<E>, listener: Listener<in E>): Subscription(source)

Subscribes to events of type.

Return

a handle that removes the listener

Since

api 1

Parameters

type

the event class, for example IgnitionChanged.class

listener

called on the plugin's worker thread