For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/CustomCommandRegistry.md.

Class: CustomCommandRegistry

Beta

提供注册自定义命令的功能。

Provides the functionality for registering custom commands.

Methods

registerCommand()

registerCommand(customCommand, callback): void

World Mutation Early Execution Beta

Parameters

customCommand

CustomCommand

callback

(origin, ...args) => CustomCommandResult | undefined

命令执行时触发的回调。

The callback triggered when the command executes.

Returns

void

Remarks

注册一个自定义命令,该命令在执行时触发脚本回调。

Registers a custom command that when executed triggers a script callback.

Throws

This function can throw errors.

CustomCommandError

EngineError

NamespaceNameError


registerEnum()

registerEnum(name, values): void

World Mutation Early Execution Beta

Parameters

name

string

values

string[]

Returns

void

Remarks

注册一个自定义命令枚举。

Registers a custom command enum.

Throws

This function can throw errors.

CustomCommandError

EngineError

NamespaceNameError