Reference

This page can be used to aid finding which variable you want to use in your webpage:

  • $MC_STATUS – Contains all the main server variables.
  • $MC_PLAYER – Contains all the variables for all the players that have ever been on the server.
  • $MC_WORLD – Contains all the variables for all the worlds.
  • $MC_ONLINE_PLAYER – Contains all the variables for all online players.
  • $MC_CHAT – Contains all the chat messages.

Notes

  • The default world can be accessed with $MC_WORLD[0]
  • Worlds are accessed by worldID, NOT name.
  • Data in $MC_ONLINE_PLAYER will contain duplicates from $MC_PLAYER

Reference

$MC_STATUS

Name Variable Description Typical Value
Server Name $MC_STATUS[“Server Name”] Server Name according to the config file Craftbukkit
MOTD $MC_STATUS[“MOTD”] Server MOTD according to the config file Hello Everybody!
Status $MC_STATUS[“Status”] Server Status ONLINE/OFFLINE
Online $MC_STATUS[“Online”] Is is on Online Mode YES/NO
IP $MC_STATUS[“IP”] The IP address according to the config file 192.168.1.1
Max Players $MC_STATUS[“Max Players”] Maximum amount of players allowed on at once 20
Online Players $MC_STATUS[“Online Players”] The number of players currently online 1
Nether $MC_STATUS[“Nether”] Is the Nether Enabled? YES/NO
End $MC_STATUS[“End”] Is the End Enabled? YES/NO
Port $MC_STATUS[“Port”] The server port according to the config file 25565
Tick Length $MC_STATUS[“Tick Length”] Can be used to measure lag. The length in ms of each server tick (Should be close to 50) 51.4
Ticks Per Second $MC_STATUS[“TPS”] Can be used to measure lag. How many ticks are running per second (should be close to 20) 19
Version $MC_STATUS[“Version”] The server version. git-Bukkit-1.6.2-R1.0-6-g7d680d3 (MC: 1.6.4
Flight $MC_STATUS[“Flight”] Does the server allow flight? YES/NO
Max View Distance $MC_STATUS[“Max View Distance”] The Maximum distance players can view on this server, in chunks 25
Mob Spawn Limit $MC_STATUS[“Mob Spawn Limit”] The amount of mobs that are allowed to spawn in any 1 chunk 75

$MC_WORLD

x must be replaced with the world ID of the world you are retreiving the variable for
Name Variable Description Typical Value
Name $MC_WORLD[x]->Name Name of the world World One
Time $MC_WORLD[x]->Time The world time (0-24000) 22077
Type $MC_WORLD[x]->Type The world type NORMAL/END/NETHER
Difficulty $MC_WORLD[x]->Difficulty The difficulty of the world PEACEFUL/EASY/NORMAL/HARD
Max Height $MC_WORLD[x]->{“Max Height”} The maximum height that can be built at 256
Sea Level $MC_WORLD[x]->{“Sea Level”} The sea level of the world 64
Weather Remaining $MC_WORLD[x]->{“Weather Remaining”} The amount of time in ticks remaining of the current weather conditions 17503
Storm? $MC_WORLD[x]->{“Storm?”} Is there currently a storm YES/NO
Seed $MC_WORLD[x]->Seed The seed of the world 2.07694E+18
Ticks Per Animal Spawn $MC_WORLD[x]->{“Ticks Per Animal Spawn”} The amount of ticks between animal spawns. 400
Ticks Per Monster Spawn $MC_WORLD[x]->{“Ticks Per Monster Spawn”} The amount of ticks between monster spawns. 1
Animals? $MC_WORLD[x]->{“Animals?”} Are Animals allowed on the server YES/NO
Monsters? $MC_WORLD[x]->{“Monsters?”} Are Monsters allowed on the server YES/NO
Structures? $MC_WORLD[x]->{“Structures?”} Are Atructures being generated YES/NO

$MC_PLAYER or $MC_ONLINE_PLAYER

p must be replaced with the player name that the variable is being retreived for
Name Variable Description Typical Value
Name $MC_PLAYER[“p”]->Name Player Name rjsowden
Display Name $MC_PLAYER[“p”]->{“Display Name”} Player’s display name (Can be edited by servers) [Admin] Rjsowden
IP $MC_PLAYER[“p”]->IP Player’s IP (Warning: Ips may be subject to Data Privacy Laws) 10.123.3.32
Health $MC_PLAYER[“p”]->Health Player’s health in half-hearts 15.5
Level $MC_PLAYER[“p”]->Level Player’s level 5
First Play $MC_PLAYER[“p”]->{“First Play”} The UNIX timestamp at which the user first logged in to this server 106328723
Local Time $MC_PLAYER[“p”]->{“Local Time”} The time in ticks at which the client is at 12000
Time Without Damage $MC_PLAYER[“p”]->{“Time Without Damage”} The time in ticks since they were last damaged 10000
EXP $MC_PLAYER[“p”]->EXP The total EXP of the player 3
OP $MC_PLAYER[“p”]->OP Is the player an op? YES/NO
Whitelisted $MC_PLAYER[“p”]->Whitelisted Is the player whitelisted YES/NO
Banned $MC_PLAYER[“p”]->Banned IS the player banned? YES/NO
Flying $MC_PLAYER[“p”]->Flying Is the player currently flying? YES/NO
Online $MC_PLAYER[“p”]->Online Is the player on the server now? YES/NO
Dead $MC_PLAYER[“p”]->Dead Is the player dead? YES/NO
Sprinting $MC_PLAYER[“p”]->Sprinting Is the player running? YES/NO
Sleeping $MC_PLAYER[“p”]->Sleeping Is the player in a bed? YES/NO

Example Data Dumps:

This data shows what the results of a var_dump should look like on each array

$MC_STATUS

array(30) {
 ["End"]=>
 string(3) "YES"
 ["Flight"]=>
 string(3) "YES"
 ["IP"]=>
 string(0) ""
 ["LastUpdate"]=>
 string(10) "1382171778"
 ["Max Players"]=>
 string(2) "20"
 ["Max View Distance"]=>
 string(2) "10"
 ["Mob Spawn Limit"]=>
 string(2) "70"
 ["MOTD"]=>
 string(16) "TNHW FILMING SET"
 ["Nether"]=>
 string(3) "YES"
 ["Online"]=>
 string(2) "NO"
 ["Online Players"]=>
 string(1) "0"
 ["Port"]=>
 string(5) "25565"
 ["Server"]=>
 string(0) ""
 ["Server Name"]=>
 string(11) "CraftBukkit"
 ["Status"]=>
 string(7) "OFFLINE"
 ["Tick Length"]=>
 string(4) "49.0"
 ["TPS"]=>
 string(18) "20.408163265306122"
 ["val"]=>
 string(6) "ONLINE"
 ["var"]=>
 string(6) "Status"
 ["Version"]=>
 string(44) "git-Bukkit-1.6.2-R1.0-6-g7d680d3 (MC: 1.6.4)"

$MC_WORLD

array(3) {
  [0]=>
  object(stdClass)#2 (15) {
    ["Name"]=>
    string(9) "World One"
    ["Time"]=>
    string(5) "22077"
    ["Max Height"]=>
    string(3) "256"
    ["Sea Level"]=>
    string(2) "64"
    ["Weather Remaining"]=>
    string(5) "17503"
    ["Seed"]=>
    string(19) "2076940367642265970"
    ["Ticks Per Animal Spawn"]=>
    string(3) "400"
    ["Ticks Per Monster Spawn"]=>
    string(1) "1"
    ["Type"]=>
    string(6) "NORMAL"
    ["Difficulty"]=>
    string(8) "PEACEFUL"
    ["PVP"]=>
    string(3) "YES"
    ["Animals?"]=>
    string(3) "YES"
    ["Monsters?"]=>
    string(3) "YES"
    ["Strutures?"]=>
    string(3) "YES"
    ["Storm?"]=>
    string(3) "YES"
  }
  [1]=>
  object(stdClass)#5 (15) {
    ["Name"]=>
    string(16) "World One_nether"
    ["Time"]=>
    string(5) "22077"
    ["Max Height"]=>
    string(3) "256"
    ["Sea Level"]=>
    string(2) "64"
    ["Weather Remaining"]=>
    string(1) "0"
    ["Seed"]=>
    string(19) "2076940367642265970"
    ["Ticks Per Animal Spawn"]=>
    string(3) "400"
    ["Ticks Per Monster Spawn"]=>
    string(1) "1"
    ["Type"]=>
    string(6) "NETHER"
    ["Difficulty"]=>
    string(8) "PEACEFUL"
    ["PVP"]=>
    string(3) "YES"
    ["Animals?"]=>
    string(3) "YES"
    ["Monsters?"]=>
    string(3) "YES"
    ["Strutures?"]=>
    string(3) "YES"
    ["Storm?"]=>
    string(2) "NO"
  }
  [2]=>
  object(stdClass)#6 (15) {
    ["Name"]=>
    string(17) "World One_the_end"
    ["Time"]=>
    string(5) "22078"
    ["Max Height"]=>
    string(3) "256"
    ["Sea Level"]=>
    string(2) "64"
    ["Weather Remaining"]=>
    string(1) "0"
    ["Seed"]=>
    string(19) "2076940367642265970"
    ["Ticks Per Animal Spawn"]=>
    string(3) "400"
    ["Ticks Per Monster Spawn"]=>
    string(1) "1"
    ["Type"]=>
    string(7) "THE_END"
    ["Difficulty"]=>
    string(8) "PEACEFUL"
    ["PVP"]=>
    string(3) "YES"
    ["Animals?"]=>
    string(3) "YES"
    ["Monsters?"]=>
    string(3) "YES"
    ["Strutures?"]=>
    string(3) "YES"
    ["Storm?"]=>
    string(2) "NO"
  }
}

$MC_USER or $MC_ONLINE_PLAYER

array(1) {
  ["rjsowden"]=>
  object(stdClass)#3 (17) {
    ["Name"]=>
    string(8) "rjsowden"
    ["Display Name"]=>
    string(8) "rjsowden"
    ["IP"]=>
    string(9) "127.0.0.1"
    ["Health"]=>
    string(4) "20.0"
    ["Level"]=>
    string(3) "0.0"
    ["First Play"]=>
    string(13) "2.147483647E9"
    ["Local Time"]=>
    string(8) "238078.0"
    ["Time Without Damage"]=>
    string(3) "0.0"
    ["EXP"]=>
    string(3) "3.0"
    ["OP"]=>
    string(3) "YES"
    ["Whitelisted"]=>
    string(2) "NO"
    ["Banned"]=>
    string(2) "NO"
    ["Flying"]=>
    string(2) "NO"
    ["Online"]=>
    string(2) "NO"
    ["Dead"]=>
    string(2) "NO"
    ["Sprinting"]=>
    string(2) "NO"
    ["Sleeping"]=>
    string(2) "NO"
  }
}