registerSuspend

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

Registers an event listener with suspending functions. Does exactly the same thing as server.getEventManager().register but makes suspension functions possible. Example:

class MyListener { @Subscribe suspend fun onLoginEvent(event: PostLoginEvent) {

    }

}

Parameters

listener

Velocity Listener.

plugin

Velocity Plugin.

fun <E> <ERROR CLASS>.registerSuspend(plugin: Any, eventClass: Class<E>, handler: suspend (E) -> Unit)

Registers a new event listener with a functional style listener.

Parameters

plugin

Velocity Plugin.

eventClass

Velocity Event class

handler

suspend invocation

fun <E> <ERROR CLASS>.registerSuspend(plugin: Any, eventClass: Class<E>, postOrder: <ERROR CLASS>, handler: suspend (E) -> Unit)

Registers a new event listener with a functional style listener.

Parameters

plugin

Velocity Plugin.

eventClass

Velocity Event class

postOrder

postOrder parameter,

handler

suspend invocation

fun <ERROR CLASS>.registerSuspend(meta: <ERROR CLASS>, command: SuspendingSimpleCommand, plugin: Any)

Registers an command executor with suspending function. Does exactly the same as CommandManager.register

Parameters

meta

CommandMeta.

plugin

Velocity Plugin.

command

SuspendingCommand.