registerSuspendingListeners

fun <ERROR CLASS>.registerSuspendingListeners(plugin: <ERROR CLASS>, listener: Any)

Registers an event listener with suspending functions. Does exactly the same thing as PluginManager.registerEvents but makes suspend functions possible. Example:

class MyPlayerJoinListener : Listener{ @EventHandler suspend fun onPlayerJoinEvent(event: PlayerJoinEvent) {

    }

}

Parameters

listener

Bukkit Listener.

plugin

Bukkit Plugin.