Variables
Updated 25 Mar 2026Local variables
Created with set and visible only inside the current script execution.
set $score = 0
set $name = "Steve"
set $alive = true
Global variables
Shared across all scripts for the lifetime of the server session. Prefix with global.
set global $coins = $coins + 1
set global $motd = "Have fun!"
Variable names
- Always start with
$. - Case-insensitive (
$Scoreand$scoreare the same). - Can contain letters, digits and underscores.
Special player properties
Available in any event or script with a player context — no $ prefix needed.
| Token | Value |
|---|---|
player.name | Player's username |
player.displayname | Display name (may include colour) |
player.health | Current health (0–20) |
player.max_health | Maximum health (usually 20) |
player.level | XP level |
player.x / player.y / player.z | Block coordinates |
player.world | World name |
player.gamemode | survival, creative, adventure, spectator |
player.food | Food level (0–20) |
player.exp | Total experience points |
player.ping | Connection latency in milliseconds |
player.uuid | Player UUID string |
player.flying | true if the player is currently flying |
player.op | true if the player is an operator |
send "You are at player.x, player.y, player.z" to player
send "Health: player.health / player.max_health" to player
if player.op == true:
send "&cOp-only area!" to player