Is it possible to open an inventory In a hashmap. So for example I have this hashmap <Player,Inventory> Is it possible to open the inventory which is the value?
One more thing does the inventory get updated when something is put in it? And how do I add an item to the inventory?
Yes, the inventory will be a "live" view of the one shown to the player, so if they add/remove/modify you will see the changes. Inventory.addItem will work as normal.
So another question if another players has that inventory open and another puts items, does it automatically update?
No, it shouldn't. There's an update() or updateInventory() method that you would probably need to use.
Agree, I don't think the other poster is correct there. The inventory will be shared, just like if you are invsee'ing another player's inventory, all players will see updates immediately.
Well you will need to be creating the inventories ... just having a hashmap doesn't mean you have inventories, you have to .put() things in the HashMap. So create it with a title and slot number: https://hub.spigotmc.org/javadocs/s...ntory.InventoryHolder, int, java.lang.String)