Executing Commands
Learn how to run commands as the clicking player or as the server console (elevated privileges).
Running Player Commands
Commands are executed with the permissions of the player who clicked the item.
Shorthand Syntax
menu-items:
- slot: 11
material: COMPASS
name: "&aSpawn"
command: "/spawn" # Slashes are optional
Typed Action (type: player-command)
menu-items:
- slot: 11
material: COMPASS
name: "&aSpawn"
action:
type: player-command
command: "spawn"
Running Console Commands (type: console-command)
Commands are executed with full console privileges. Ideal for rewarding items (/give), updating balances (/eco give), or modifying permissions without granting operators status to players.
menu-items:
- slot: 13
material: GOLD_INGOT
name: "&6Claim Daily Reward"
action:
type: console-command
command: "eco give {player} 500"
:::tip Explicit Executor (type: command)
type: command allows explicitly setting the executor:
action:
type: command
executor: console # player or console
command: "give {player} diamond 1"
:::
Variables and Placeholders in Commands
Command strings support internal variables and PlaceholderAPI:
| Variable | Replacement |
|---|---|
{player} | Player's Minecraft username |
{menu} | Current menu ID |
{session} | Unique session identifier |
{input} / {input.<id>} | Values collected from inputs or chat |
%<placeholder>% | Any PlaceholderAPI placeholder (e.g. %vault_eco_balance%) |
Example
actions:
- type: console-command
command: "say &e{player} &fpurchased a VIP package!"
- type: console-command
command: "lp user {player} parent add vip"