I currently have the following setup:
- Player opens a GUI via the /gui command The inventory opens with some generated ItemStacks (Banner)
- Player clicks on the banners and they get added to their inventory via player.addItemStackToInventory()
- Player closes the GUI when done
- The player now seems to have the items in their inventory, but when you try to interact with them the inventory gets "updated" and the added Items vanish.
Why does this happen and how can I prevent it?
The code can be found here.