⌘K

Variables

Updated 25 Mar 2026

Local 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 ($Score and $score are the same).
  • Can contain letters, digits and underscores.

Special player properties

Available in any event or script with a player context — no $ prefix needed.

TokenValue
player.namePlayer's username
player.displaynameDisplay name (may include colour)
player.healthCurrent health (0–20)
player.max_healthMaximum health (usually 20)
player.levelXP level
player.x / player.y / player.zBlock coordinates
player.worldWorld name
player.gamemodesurvival, creative, adventure, spectator
player.foodFood level (0–20)
player.expTotal experience points
player.pingConnection latency in milliseconds
player.uuidPlayer UUID string
player.flyingtrue if the player is currently flying
player.optrue 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