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
| Name | Type | Description |
|---|---|---|
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
| Key | Type | Default | Description |
|---|---|---|---|
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>.
- Set Command Name to greet
- Connect sender → Player Message
- Use List Get (index 0) on args to get the name argument
- Use String Format ("{0} says hello to {1}!") before the message