Triggers trigger/command

Command Trigger

Registers a custom command on the server and fires the graph when it is executed.

Note: The command is registered dynamically when the graph is enabled and unregistered when it is disabled. Use a List Get node (index 0, 1, …) to access individual arguments from the args output.

Outputs

NameTypeDescription
exec exec Fires when the command is executed.
sender sender The CommandSender (player or console) who ran the command.
args list List of string arguments passed after the command name.

Properties

KeyTypeDefaultDescription
command string "myscript" The command without the leading slash.
description string "PNode script command" Shown in /help.
permission string "" Required permission. Leave blank to allow everyone.
playerOnly boolean false When true, console cannot use the command.

Examples

Simple /greet command

Send "Hello, <name>!" when a player runs /greet <name>.

  1. Set Command Name to greet
  2. Connect sender → Player Message
  3. Use List Get (index 0) on args to get the name argument
  4. Use String Format ("{0} says hello to {1}!") before the message