How to make GUI slots can store items in it

Started by Bodi on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make GUI slots can store items in it

GUI slots just drop items if i closed the GUI , i want the slot to save the item when i close the GUI (just like inventory) .
 

Joined Jun 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You need to set the number…
Tue, 06/29/2021 - 23:36

You need to set the number of slots in your item/block

it must be the same number

 

bag

 

bind

GUI in use

Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hey so i did what you said…
Thu, 05/29/2025 - 16:49

hey so i did what you said to do but how it crashes whenever i try open the gui

Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@kolokythi, the size of…
Fri, 05/30/2025 - 20:24

@kolokythi,

the size of inventory (slot count) works like so:


The first slot you add in the GUI beginns with the slot id 0. for example if you have 6 slots its id's is like this:

0, 1, 2, 3, 4, 5

Therefore you need to type the number of slots not the last slot id.