-
Notifications
You must be signed in to change notification settings - Fork 5
Placeholders
What is Placeholders? Placeholders is a plugin designed to help plugin developers and server owners, by taking the trouble out of coding placeholders. Placeholders currently has over 70 pre-coded placeholders, but if that's not enough for you, you can add your own, by adding code to the placeholders.php file!
Notes:
The placeholders are case-insensitive.
$gvars contains global placeholders (like server info, and top kills)
$svars contains personal placeholders (like IP, name, and money)// Example placeholders
$svars["{example_placeholder}"] = "Example!";
// You can make a placeholder out of normal text if you want
// This will replace "this is just text" with "Another example!"$gvars["this is just text"] = "Another example!"
-
{x}
-
{y}
-
{z}
-
{name}
-
{displayname}
-
{gamemode}
-
{health}
-
{ip}
-
{nametag}
-
{yaw}
-
{pitch}
-
{world}
-
{world_seed}
-
{money}
-
{group}
-
{score}
- {difficulty}
- {}
- {}
- {}
- {}
- {}
- {}
$manager = $this->getServer()->getPluginManager();
$msg = "Your ip is {ip}";
if(($placeholders = $manager->getPlugin("Placeholders")) !== null){
$msg = $placeholders->allPlaceholders($msg, $player);
/* Output: "Your ip is 192.168.0.18" (Player's IP) */
}