Hello! I have made a plugin that contains leaderboards but I found the problem that the leadboard does not update (Im noob ) and I wanted to know if any of you could help me ... Code: PHP: <?phpnamespace IvanCraft623\EnderHCF\Entity;use pocketmine\entity\Monster;use pocketmine\entity\EntityIds;use pocketmine\scheduler\ClosureTask;use IvanCraft623\EnderHCF\EnderHCF;class TopKills extends Monster{ const NETWORK_ID = EntityIds::CHICKEN; public $height = 0.7; public $width = 0.4; public $gravity = 0; protected $plugin; public function getName(): string { return "TopKills"; } public function initEntity(): void { parent::initEntity(); $this->setImmobile(true); $this->setHealth($this->getHealth()); $this->setNameTagAlwaysVisible(true); $this->setScale(0.001); } public function onUpdate(int $currentTick): bool { $kills = EnderHCF::getInstance()->kills; $AllKills = $kills->getAll(); arsort($AllKills); $top = 1; $nametag = "§l§f✘ §6Leaderboard §eKills §f✘\n"; foreach($AllKills as $name => $value){ if($top > 10)break; $nametag .= "§6#{$top} §f{$name} §7- §b{$value} §3kills\n"; $top++; } $this->setNameTag($nametag); return parent::onUpdate($currentTick); }} Plugin: http://www.mediafire.com/file/4zk3gznn0kgfnf0/EnderHCF.zip/file
instead of PHP: return parent::onUpdate($currentTick); do PHP: parent::onUpdate($currentTick);return true;
"I have made a plugin" it's a copy paste letter by letter, space by space of my Speed Coding . And you don't have to make anything, the entity is updated automatically