Skip to content
BasaltSoftware
Bedrock 1.26.60

Site colour

Discord
Esc

    ↑↓ moveEnter openEsc close

    Keyboard shortcuts
    Ctrl K
    Search the whole site, from any page
    /
    Jump to the sidebar search, or search the whole site where there isn't one
    Enter
    Open the top search result
    Esc
    Clear the search, or close this panel
    ?
    Show these shortcuts
    Commands

    CustomCommandRegistry

    Class in @minecraft/server

    Registers custom commands, during startup only.

    import { CustomCommandRegistry } from '@minecraft/server';
    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
    customCommand
    CustomCommand
    callback
    (origin: CustomCommandOrigin, ...args: any[]) => CustomCommandResult | undefined
    Throws
    • CustomCommandError if it’s not startup, the name has no namespace, or it’s taken.
    registerEnum(name: string, values: string[]): void;

    Adds a list of values an Enum parameter can take.

    Parameters
    name
    string
    values
    string[]

    StartupEvent.customCommandRegistry