Sponge API Player Inventory

I was wondering if anyone could provide an example of opening a players inventory, not as a chest inventory but as if the player themselves pressed E to open their inventory.

The only person that would be viewing the inventory is the player themselves, it will be part of a click inventory event the player themselves trigger that functions sort of like a back button. So far I’ve only been able to view it as a chest.

I’m on Minecraft 1.12.2, using the latest version of SpongeForge.

Thank you.

Hey, sorry but unless your sending a actual inventory to attach to the player inventory, its not possible to open the player inventory. I tried tricking it by sending a inventory to open with a size of 0, but no luck.

The best luck I had was sending a chest inventory of the size of 9 as its barly noticable.

The issue here is vanilla minecraft does not have any network code to open just the player inventory. There also isnt a packet anymore for when the player inventory opens just the inventory, all of it is handled on the client.

Hope that helps

1 Like

Sadly that makes a lot of sense, considering how invsee itself opens it as a chest I began to suspect it wasn’t possible.

Also, I too had the idea of setting the inventory size to 0 and had no luck. Then thought maybe there was a Minecraft command to open the inventory but I suppose not.

It just seems like something so simple that I began questioning my sanity, lol. But luckily its not required functionality. At least now I can stop looking.

Thank you for responding.