Actions¶
An action is one thing that happens when a player clicks. Written as
[type] payload.
left_click_commands:
- "[message] &aOn your way."
- "[close]"
- "[console] warp %player_name% market"
- "[sound] ENTITY_ENDERMAN_TELEPORT"
A line with no [type] runs as a player command, because that is what
somebody who forgot the brackets almost always meant.
When they run¶
| Key | Fires on |
|---|---|
click_commands |
Any click at all |
left_click_commands |
Left click |
right_click_commands |
Right click |
shift_left_click_commands |
Shift and left |
shift_right_click_commands |
Shift and right |
middle_click_commands |
Middle click |
drop_click_commands |
The drop key |
A specific list and click_commands both run, specific first.
Messages and text¶
[message] <text> |
To the player who clicked |
[broadcast] <text> |
To everybody online |
[title] Main\|Sub\|in\|stay\|out |
A title. Everything after the first part is optional |
[actionbar] <text> |
Above the hotbar |
[chat] <text> |
Makes the player say it |
Commands¶
[player] <command> |
As the player, with their permissions |
[console] <command> |
As the server |
[op] <command> |
As the player, with op granted for that one command |
[console] and [op] are the powerful ones
Both run things the player could not run themselves. That is the point of
them, and it is also how a menu becomes a security hole. Anything a player
can influence, such as a %placeholder% that resolves to their own name,
ends up inside a command running with full rights.
[op] restores the player's original op state in a finally block, so a
command that throws cannot leave an ordinary player permanently op.
Menus¶
[open] <menu> [args...] |
Open another menu |
[back] |
The menu they came from |
[refresh] |
Redraw this one in place |
[close] |
Close it |
[refresh] is the one to reach for after an action changes something the menu
displays, such as buying a rank.
Money, items and experience¶
[givemoney] <amount> |
|
[takemoney] <amount> |
|
[giveitem] <item> [amount] |
Accepts the same references as an icon |
[takeitem] <material> [amount] |
|
[giveexp] <amount> / [takeexp] <amount> |
Experience points |
[givelevel] <amount> / [takelevel] <amount> |
Experience levels |
[giveitem] drops the remainder at the player's feet when their inventory is
full, rather than deleting it.
Money needs Vault with any economy provider, or Ember Coins, which is also how it works on Folia where Vault does not run.
Sound¶
[sound] <SOUND> [volume] [pitch] |
To the clicker |
[broadcastsound] <SOUND> [volume] [pitch] |
To everybody |
Sound names are resolved by name, so a name that does not exist on your version logs one warning instead of breaking the click.
Proxies¶
[connect] <server> sends the player to another server on your BungeeCord or
Velocity proxy.
Chance and delay¶
Either modifier can go in front of any action, in either order.
- "[chance=25] [message] &6Lucky."
- "[delay=40] [message] &7Two seconds later."
- "[chance=10] [delay=20] [console] give %player_name% diamond 1"
chance is a percentage. delay is in ticks, twenty to the second. A delayed
action checks the player is still online before it runs.
Placeholders¶
Every payload goes through PlaceholderAPI first, so any placeholder from any expansion works in any action.