Class in @minecraft/server
Registers custom commands, during startup only.
import { CustomCommandRegistry } from '@minecraft/server';Methods
Section titled “Methods”registerCommand
Section titled “registerCommand”registerCommand( customCommand: CustomCommand, callback: (origin: CustomCommandOrigin, ...args: any[]) => CustomCommandResult | undefined,): void;Adds a command. Arguments come after the origin in the order the parameters are listed:
booleans, numbers, strings, Player[] for selectors and a Vector3 for locations.
Parameters
customCommandCustomCommandcallback(origin: CustomCommandOrigin, ...args: any[]) => CustomCommandResult | undefined
Throws
- CustomCommandError if it’s not startup, the name has no namespace, or it’s taken.
registerEnum
Section titled “registerEnum”registerEnum(name: string, values: string[]): void;Adds a list of values an Enum parameter can take.
Parameters
namestringvaluesstring[]