Scoreboard is a PocketMine-MP & Altay plugin that helps creatings scoreboard in MCPE 1.7! Credit: TwistedAsylumMC
- You can get the
.phar
file by clicking here. - Add the
.phar
file to your/plugins
directory. - You can edit the Scoreboard in config.yml
/plugins/Scoreboard
& restart your server. Note: This plugin only works on MCPE 1.7 and above.
You'll need to import the Napol\Scoreboard\Scoreboard.php
class. This is the main class and probably the only class you'll need for creating Scoreboard.
<?php
use Napol\Scoreboard\Scoreboard;
In the small documentation, $api
will be used to refer to an instance of Scoreboards. You can create an instance by doing:
$api = Scoreboard::getInstance();
$api::new()
creates a new Scoreboard with an objective name, display name and then sends it to a player.
/** @var Player $player */
$api->new($player, "ObjectiveName", "Title of scoreboard in game");
$api::remove()
removes a Scoreboard from a player. You do not need to enter an objective name as it is stored from $api::new()
.
/** @var Player $player */
$api->remove($player);
$api::setLine()
sets a line's text. This only works if the player has a scoreboard sent to them. The 1
is the line, and can go up to 15
.
/** @var Player $player */
$api->setLine($player, 1, "Line Text");
$api::getObjectiveName
returns a string of the Player's objective name from their scoreboard, returns null if the player does not have a scoreboard.
/** @var Player $player */
$api->getObjectiveName($player);
To update an existing scoreboard, you can simply use $api::new()
again, and it will remove the Player's existing one, and add the new one.
$api->new($player, 1, "Line 1");
$api->new($player, 2, "Line 2");
$api->new($player, 3, "Line 3");