Open kristophergeou opened 8 months ago
We need some more clarifications on what exactly you're trying to achieve here.
I can think of 2 things you might be saying:
yeah i was talking about the second option :/
hide the items from the player inventory: possible but I don't think we want to do this. if we mess with player inventories we have to be damn sure they won't disappear. there are just too man edge cases to be considered and I personally don't want to see the day when someone comes complaining that their player's inventories have vanished. the reason I don't want to see it is that if the server doesn't have a rollback system in place, there's no way to recover.
The "easiest" way which would avoid any issues would be, in my opinion, to send an inventory packet to the player to make it seem like his inventory is empty. And then, when the menu is closed, use Player#updateInventory() and Spigot will send back the player's inv as if nothing happened. That way, we don't need to store the player's inv nor fear any unfortunate accident with potential server crashes and stuff. We'd need to rely on NMS though
Basically
hide_inventory: true/false
if you want to hide a user's inventory (items) when they open a menu, so everything looks more nice and clear