So I made a custom Join/Leave message plugin and when I join or leave the server it sends the message x2 and I need it to send once. PHP: public function onJoin(PlayerJoinEvent $event) { $event->setJoinMessage(""); $player = $event->getPlayer(); $name = $player->getName(); $this->getServer()->broadcastMessage(TF::GREEN . "$name Has Joined the Server!"); } public function onQuit(PlayerQuitEvent $event) { $event->setQuitMessage(""); $player = $event->getPlayer(); $name = $player->getName(); $this->getServer()->broadcastMessage(TF::RED . "$name Has Quit the Server!"); }
You probably registered your listener twice Easy fix PHP: $event->setJoinMessage(TF::GREEN . "$name Has Joined the Server!"); $event->setQuitMessage(TF::RED . "$name Has Quit the Server!");