Hey Today i m asked myself how can allow a player who is banned to join the server and add some code in the fonction?
He probably wants to teleport/transfer a banned player somewhere where the player can read rules, see a clock or can apologise/whatever
That fuk*** good idea PHP: public function bannedPlayer(PlayerKickEvent $event, PlayerChatEvent $chat){ $player = $event->getPlayer(); if($player->isBanned()){ $player->setImmobile(true); $chat->setCancelled(); $event->setCancelled(); } }
you totally get it wrong you need to create another function for the playerchatevent with the isbanned then set to canceled