9.1. Script Reference
Quick reference for script types and operators. For detailed explanations, see Scripts.
9.1.1. Script Types
Scripts are bound to triggers that determine when they execute.
Type |
Trigger |
Available Variables |
|---|---|---|
interact |
Player right-clicks the bound block |
|
walk |
Player enters the space above the bound coordinates |
|
ground |
Player stands on the bound block (not jumping) |
|
entity |
Player right-clicks the bound entity |
|
area |
Player enters the bound WorldGuard region |
|
function |
Called explicitly from other scripts |
(parameters only) |
method |
Called on an instance of a custom type |
|
constructor |
Called when creating an instance of a custom type |
|
9.1.2. Script Operators
Every script line begins with an operator. Blank lines and lines starting with # are ignored.
Operator |
Description |
|---|---|
|
Execute a command with the player’s permissions. |
|
Execute a command with elevated (semi-admin) permissions. Most common. |
|
Execute a command from the server console. Full permissions but no player context. |
|
Send a message to the player. Supports |
|
Wait for player chat input, store in variable. Script ends if time expires. |
|
Make the next |
|
Set the active namespace for the rest of the script. |
|
Define a local variable, optionally with an initial value. |
|
Evaluate an expression, optionally assigning the result to a variable. |
|
Pause execution for the specified duration. |
|
Prevent this player from re-triggering the script until time expires. |
|
Prevent any player from re-triggering the script until time expires. |
|
Cancel the default interaction (e.g., prevent button click animation). |
|
Stop execution and optionally return a value (for functions). |
|
Remove the one-tick delay after command operators. |
|
Restore the one-tick delay after |
|
Begin a conditional block; execute following lines if condition is true. |
|
Alternative condition if previous |
|
Execute following lines if all previous conditions were false. |
|
End a conditional block. |
|
Iterate over a list, binding each element to the named variable. |
|
End a |
|
Comment line (ignored by the interpreter). |
9.1.3. Script Actions
Commands for managing scripts. Parent command: /script
Action |
Description |
|---|---|
|
Add a line to the script. Specify |
|
Display the script contents. |
|
Delete the entire script, or just a specific line. |
|
Show script metadata. |
|
Upload the script to paste.minr.org. |
|
Download and import a script from paste.minr.org. |
|
Copy all scripts in WorldEdit selection to clipboard. |
|
Paste scripts of type from clipboard. |
|
Remove all scripts of type in WorldEdit selection. |
|
Count scripts of type in WorldEdit selection. |
|
Undo the last script command (up to 10 actions). |