you can use DataPacketReceiveEvent, check if the packet is LoginPacket, if it is, you get the value PHP: $ui = $packet->clientData["UIProfile"];/** int(0) is Classic, int(1) is Pocket */ keep in mind the player can change their UIProfile while in the server
Sadly nothing can be done about this. The client sends no packets to the server at the time they change their UI profile, so it doesn't seem like there's any way. There isn't any way to lock the toggle either.