I want to put join message (PurePerms nametag) has joined the game The name tag I mean the nametag that pureperms gives you in the game, which is the format you configure, but I don't know how to obtain it.
You can do this for their tag PHP: $player->getNameTag() for someone's group use this function PHP: public function getGroup(Player $player) { $this->group = $this->getServer()->getPluginManager()->getPlugin("PurePerms")->getUserDataMgr()->getGroup($player)->getName(); return $this->group; }
Hi guys I found the solution by looking at the PureChat code. For those who want to know how I got the nametag... I have used these variables: PHP: $player = $event->getPlayer();$levelName = $this->getServer()->getPluginManager()->getPlugin("PureChat")->getConfig()->get("enable-multiworld-chat") ? $player->getLevel()->getName() : null;$nametag = $this->getServer()->getPluginManager()->getPlugin("PureChat")->getNametag($player, $levelName); An example where I use the nametag that pureperms assigns you: PHP: public function onJoin(PlayerJoinEvent $event){ $player = $event->getPlayer(); $levelName = $this->getServer()->getPluginManager()->getPlugin("PureChat")->getConfig()->get("enable-multiworld-chat") ? $player->getLevel()->getName() : null; $nametag = $this->getServer()->getPluginManager()->getPlugin("PureChat")->getNametag($player, $levelName); $event->setJoinMessage(""); $this->getServer()->broadcastMessage($nametag ."§r§7 has joined the server");}