Hi, I need help ... How do I set a NameTag on the player using PlayerJoinEvent? Sorry for my bad english. I'm Brazilian. code here: public function staffJoin(PlayerJoinEvent $event){ $dono = "Th3Ang3loGam3r"; $subdono = "SkyderGamer"; $diretores = ["ZzMarcelozZ", "MrBlendson_7w7"]; $admins = ["zGuiSS", "StrupeyUs_"]; $mods = ["DrupperzinPe", "SrEllyBr", "Speed", "zDeleted_7w7"]; $ajudantes = [null]; $p = $event->getPlayer(); if($p->getName() == $dono){ $player->setDisplayName("§8[§aDono§8]§f {$player->getName()}"); } }
Error: [23:20:25] [Server thread/CRITICAL]: "Could not pass event 'pocketmine\event\player\PlayerJoinEvent' to 'MiniCore v1': Call to a m ember function setDisplayName() on unknown on MiniCore\Main [23:20:25] [Server thread/CRITICAL]: Error: "Call to a member function setDisplayName() on unknown" (EXCEPTION) in "/MiniCore/src/ MiniCore/Main" at line 42 Line 42 is: $player->setDisplayName("§8[§aDono§8]§f {$player->getName()}");
@Fludixx It was a lack of attention ... I realized that it was $p and not $player, I solved it myself before replying to this post Thanks for the help anyway.