Variables
Updated 16 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.level | XP level |
player.x / player.y / player.z | Block coordinates |
player.world | World name |
player.gamemode | survival, creative, adventure, spectator |
send "You are at player.x, player.y, player.z" to player
send "Health: player.health / 20" to player