i tried to deny windows 10 players from join unless if they but my username but it got to deny all platforms from join even if they but my username here's the code PHP: public function onPacketReceived(DataPacketReceiveEvent $event){ //thx PMMP community for code $packet = $event->getPacket(); if($packet instanceof LoginPacket) { $player = $event->getPlayer(); $name = $player->getPlayer(); if ($packet->gameEdition === 1 && $name === "r7vmc") { } else { $player->close("", "§l§4ﺮﻓﺮﻴﺴﻟﺍ ﻝﻮﺧﺩ ﻦﻣ ﻦﻴﻋﻮﻨﻤﻣ 10 ﺯﻭﺪﻨﻳﻭ ﻦﻴﺒﻋﻻ"); } } }
I think you meant $name = $player->getName() instead of $name = $player->getPlayer(). In $name, you want to store the name of the player, not the player itself. .