register Suspending Events
fun <ERROR CLASS>.registerSuspendingEvents(listener: <ERROR CLASS>, plugin: <ERROR CLASS>)
Content copied to clipboard
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.