Skip to content

@pumpkin-plugins/bedrock-addon-manager API / platform/host / onCommand

Function: onCommand() ​

onCommand(handler): number

Defined in: tools/plugin-kit/src/host.ts:67

Registers a function to run when a command node is executed.

Parameters ​

handler ​

(sender, args) => number

Receives the sender and returns the command's success count.

Returns ​

number

The id to give to executeWithHandlerId.

Pumpkin Plugins documentation