Items I put into my GUI are being destroyed

Started by notAsquare1 on

Topic category: Help with MCreator software

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Items I put into my GUI are being destroyed

I am trying to make a lunchbox that I can put items into, like a bundle but a shulker box, so it can hold 4 slots of anything. My first problem was the game crashing when I set the max slots to 4 when there were 4 in the gui, but I fixed that by setting it to 5. Now I have a problem where when I put some items in the slots (just random items, such as dark oak planks and aluminum swords), the items get destroyed when I open up the lunchbox again. Is this because I set it to not drop items when gui is not bound to any external inventory is closed? I just need a solution because my friends are wanting me to put my mod on my server asap

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is this a storage block, or…
Sat, 10/07/2023 - 18:39

Is this a storage block, or an item? 

For your first problem, just be sure to keep in mind throughout that numbering always starts with zero. (The first slot in the GUI is 0, the second slot is 1, and so on and so forth.) This is very important when referencing things, and you can get game crashes if you wind up referencing slots that don't exist.

GUI are set by default to drop items inside when closed. (Like the crafting table.) In order for a block to be able to hold items even when its bound GUI is closed, you need to make sure you have tile-entity enabled, otherwise it can't actually save item data. Otherwise, I would just double check you have the GUI binding and slot references correct.