register

fun register(command: LiteralArgumentBuilder<McBrigadierSource>)
abstract fun register(command: LiteralCommandNode<McBrigadierSource>)

Registers a brigadier command.

Parameters

command

The instance of the command to register.

Throws

If attempting to register commands after commands have already been registered.

If a command with the same name or alias already exists.


fun register(namespace: String, command: LiteralArgumentBuilder<McBrigadierSource>)
abstract fun register(namespace: String, command: LiteralCommandNode<McBrigadierSource>)

Registers a brigadier command with a custom namespace.

Parameters

namespace

The namespace prefix for this command.

command

The instance of the command to register.

Throws

If attempting to register commands after commands have already been registered.

If a command with the same name or alias already exists.


abstract fun register(name: String, command: T, vararg aliases: String)

Registers a command with its name and optional aliases.

Parameters

name

The primary name of the command.

command

The instance of the command to register.

aliases

Optional alias names for the command.

Throws

If attempting to register commands after commands have already been registered.

If a command with the same name or alias already exists.


abstract fun register(namespace: String, name: String, command: T, vararg aliases: String)

Registers a command with a custom namespace, name, and optional aliases.

The namespace overrides commandNamespace for this command, making it accessible as /namespace:command on Spigot/Paper.

Parameters

namespace

The namespace prefix for this command.

name

The primary name of the command.

command

The instance of the command to register.

aliases

Optional alias names for the command.

Throws

If attempting to register commands after commands have already been registered.

If a command with the same name or alias already exists.