register

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.

Ignored on Paper, where the owning plugin's name is always the namespace.

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.