By continuing to use this site, you agree to the Terms of Service of this website, including usage of cookies.
OK, Don't show this again
PlaceholderAPI is a powerful and flexible placeholder system for PocketMine-MP. It allows you to easily manage placeholders and dynamically replace them in messages. Whether you're creating a server with custom features or just want to improve the player experience, PlaceholderAPI has you covered!
Generals:
%online_players%
: Shows the current number of online players (count(Server::getInstance()->getOnlinePlayers())
).%max_players%
: Shows the maximum number of players allowed on the server (Server::getInstance()->getMaxPlayers()
).%server_motd%
: Displays the server's Message of the Day (Server::getInstance()->getMotd()
).%server_version%
: Displays the version of the server (Server::getInstance()->getVersion()
).%server_ip%
: Shows the IP address of the server (Server::getInstance()->getIp()
).%server_port%
: Displays the port the server is running on (Server::getInstance()->getPort()
).%player_name%
: Shows the name of the player ($player->getName()
).%player_display_name%
: Displays the display name of the player ($player->getDisplayName()
).%player_ping%
: Shows the player's ping in milliseconds ($player->getNetworkSession()->getPing()
).%player_ip%
: Displays the player's IP address ($player->getNetworkSession()->getIp()
).%player_health%
: Shows the player's current health ($player->getHealth()
).%player_max_health%
: Displays the player's maximum health ($player->getMaxHealth()
).%player_x%
: Displays the player's X-coordinate ($player->getPosition()->getX()
).%player_y%
: Displays the player's Y-coordinate ($player->getPosition()->getY()
).%player_z%
: Displays the player's Z-coordinate ($player->getPosition()->getZ()
).%player_world%
: Shows the name of the world the player is in ($player->getWorld()->getDisplayName()
).%server_time%
: Displays the current server time in H:i:s
format (date("H:i:s")
).%server_date%
: Displays the current server date in Y-m-d
format (date("Y-m-d")
).%random_number%
: Generates and shows a random number between 1 and 100 (mt_rand(1, 100)
).%total_worlds%
: Displays the total number of worlds loaded on the server (count(Server::getInstance()->getWorldManager()->getWorlds())
).%tps%
: Shows the server's ticks per second rounded to two decimal places (round(Server::getInstance()->getTicksPerSecond(), 2)
).%uptime%
: Displays the server's uptime in seconds since it started (round(microtime(true) - Server::getInstance()->getStartTime(), 2) . " seconds"
).For more detailed documentation and guides, please visit our wiki.
In your plugin or messages, you can use placeholders such as %online_players%
and %max_players%
. PlaceholderAPI will automatically replace them with the corresponding values.
$text = "%online_players%/%max_players%";
$player = $player;// If the player is not needed: $player = null;
$processedText = PlaceholderAPI::getInstance()->processPlaceholders($player, $text);
$this->getLogger()->info(processedText); // Output: 5/100 (Example output)
You can leave one review per plugin release, and delete or update your review at any time