⌘K

Variables

Updated 16 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.levelXP level
player.x / player.y / player.zBlock coordinates
player.worldWorld name
player.gamemodesurvival, creative, adventure, spectator
send "You are at player.x, player.y, player.z" to player
send "Health: player.health / 20" to player