1. Go to this page and download the library: Download galaxygames/libscoreboard library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
galaxygames / libscoreboard example snippets
use galaxygames\scoreboard\Scoreboard;
...
class EgPlugin extends PluginBase{
protected Scoreboard $scoreboard;
public function onEnable() : void{
$this->scoreboard = Scoreboard::getInstance();
}
}
/** @var int $line Line number, range from 0 to 15*/
/** @var string $context Context of the line*/
$this->scoreboard->setLine($player, $line, $context);
/** @var int $start The start line which it will flood, default: 0*/
/** @var int $end The end line where the flood end, default: 15*/
/** @var string $flood The line in the range will be flooded by this value, default: ""*/
$this->scoreboard->floodLine($player, $start, $end, $flood);
$this->scoreboard->floodLine($player, 0, 3, "hello"); // Flood from line 0 to line 3 with "hello"
$this->scoreboard->floodLine($player, 4, 14); // Flood from line 4 to line 14 with empty line
/** @var bool $brutal The removal will remove the line without putting an empty line if
this is true, default: fault */
$this->scoreboard->removeLine($player, $line, $brutal);
$this->scoreboard->removeLine($player, 1); //Remove line 1 and leave behind an empty line
$this->scoreboard->removeLine($player, 0); //Remove line 0 without leave behind an empty line
Scoreboard::getObjectiveName(Player $player); // Return the current color's name of a player
Scoreboard::clearPlayerCache(Player $player); // This should be called when player left the server
Scoreboard::clearCache(); // Clear all data
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.