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/CustomCommandOrigin.md.

Class: CustomCommandOrigin

Beta

关于命令来源的详细信息。

Details about the origins of the command.

Properties

initiator?

readonly optional initiator?: Entity

Beta

Remarks

如果此命令是通过 NPC 发起的,则返回发起 NPC 对话的实体。

If this command was initiated via an NPC, returns the entity that initiated the NPC dialogue.


sourceBlock?

readonly optional sourceBlock?: Block

Beta

Remarks

如果此命令是通过方块(如命令方块)触发的,则为来源方块。

Source block if this command was triggered via a block (e.g., a commandblock.)


sourceEntity?

readonly optional sourceEntity?: Entity

Beta

Remarks

如果此命令是由实体(如 NPC)触发的,则为来源实体。

Source entity if this command was triggered by an entity (e.g., a NPC).


sourceType

readonly sourceType: CustomCommandSource

Beta

Remarks

返回触发此命令的来源类型。

Returns the type of source that fired this command.