Today I'm going to be showing you how to check whether player's have Classic UI settings on or Pocket UI. Using the code below you get there settings. To check it, you just need to do some simple if statements. Basically PHP: if($ui === 0) {//do something} PHP: //0 = CLASSIC UI //1 = POCKET UI public function onDataReceive(\pocketmine\event\server\DataPacketReceiveEvent $ev){ if($ev->getPacket()::NETWORK_ID === \pocketmine\network\mcpe\protocol\ProtocolInfo::LOGIN_PACKET){ $ui = $ev->getPacket()->clientData[ "UIProfile"]; } }
The ui profile is changeable while playing. Does the client tell the server if it changed the ui profile?