Ok so you know how in the game settings you can choose between the Pocket GUI or the Classic GUI right? I am attempting to make a plugin that deals with a custom chest inventory where the contents look best using the Classic GUI. I have the plan on what I am going to do with it when it determines if Pocket GUI is true, I am going to block the container from being opened by the player with the Pocket GUI then send a title&subtitle telling them that they must change to Classic GUI in their game settings. SERIOUS NOTE: ↓ Please do not judge me. I am saying not to judge me because I have been called things like a fake dev, and such, I just wish to learn and make my server most advanced as possible, while being fast and fun at the same time!
Yes, it is possible to determine the Craft UI at login, as this data exists in the login packet. I have modified LoginPacket.php and Player.php to allow me to capture and display clientData["UIProfile"] in my log; so what you are trying to do should be possible with modifications to PMMP. I'm not sure if it would be possible for a plugin to access this information without modifications to the server.
Of course it's possible without modifications... Don't encourage people to modify the PMMP source code. Just use DataPacketReceiveEvent, check if the packet is a login packet, and get the information from there. The ui profile is located in $packet->clientData["UIProfile"];
The UIProfile => $value should be the integer 1, or 2. This can show you their GUI... however, nothing stops them from changing it ingame
Yeah, the LoginPacket only checks what it is when they LOGIN to the server, you'd have to have the players reconnect with the other gui to check if it updated.
Is it possible to have it check when the player attempts to open a custom chest inventory? Then from there cancel the opening of the custom chest inventory followed with a title?
Save the players ui profile in an array with their username ($packet->username), then use it when you need it
Firstly, a serious note: DO not use this as some anti dupe mechanism, these values are CLIENT PROVIDED, even tho for the time begin no one have tried to spoof it, but it can be spoofed with effort if someone really want to screw you up Secondly, on how to: vardump login packet on packet receive event, the answer should be in your sight, something about UI profile Thirdly, on doing this: People WILL not like you you, it's like blocking mobile browser because your website looks best at a PC, Generally by doing this(blocking mobile browser) you already have earn yourself a place in /r/A*holeDesign as user agent was not meant for you to block people, But for you to create a more tailored support, like example: make another good look that works on mobile and if they are mobile give them the second view, at the very least: dont block them just toss them your PC view, maybe a notice bar explaining why this website look wonky Back to this situation: Instead of blocking them, you should just create a tailored view for each profiles, PS dont be scared to use the client's inv for pocketUI to create a PC chest like view If that's too much effort, just like tell them it look best on PC profile view then send them the chest anyways There's no real need to block them I hope no one take this too personally, after all you do what you want, i am just trying to say that, they players wont really like it, that's your server and your responsibility to treat them well, not mine