Started by
yhfrag
on
Topic category: Advanced modding
How do i create a 3x3 inventory, that replaces the items in the slot after a certain amount of time.
Topic category: Advanced modding
How do i create a 3x3 inventory, that replaces the items in the slot after a certain amount of time.
I've tried to think of a way around it however i have issues:
I made a GUI with 9 slots and a inventory and bound it to a block.
I then made a procedure that runs every tick,adds 1 to the variable and checks if the slot contains the item and if it does and the variable = 60 then it replaces the item with another.
Although this is not the problem.
When i put items in the inventory and close the inventory the items pop out and are visable on the floor but i can't pick them up either. Anyone have any idea whats going on.
Also, i'm not able to asign my procedure because its missing guiInventory
Fixed the item issue. still cant set my drying procedure tho
I'm aware of the items not being able to be picked up. Also pressing the checkbox to prevent items from popping out will make them disappear inside of the slot.
The reason for this buggy behaviour is because you probably used a custom inventory name and not the inherited inventory (which is the proper way of doing inventory)
Go to your block, enable inventory there. Select inventory inherited for the GUI and things should start to work as normal.
I suggest you to check our wiki page on how to make GUIs with slots: https://mcreator.net/wiki/making-guis-slots If your GUI does not work after watching the tutorial, you might want to check our example workspace and build from there: https://mcreator.net/modification/42649/fusion-table-procedure-demo
What mod elements provide guiInventory, because i still cant assign my procedure to the block on updatetick
Do not use guiInventory and GUI procedure blocks, use block slot management procedures instead. You were told this by StellaeLux and by tutorials I linked (which you, it seems, did not check). Why are you asking in the first place, if you do not follow the advice?
Sorry i didn't quite understand the tutorial, i've fixed my mistake, I've assigned the procedure to updateTick however it still doen't work
Heres what ive done:
Var = Var + 1
If Var >= 50 then
If Item in Inventory = Item1 in slot 0 then
Set Item2 in slot 0
Do not use guiInventory and GUI procedure blocks, use block slot management procedures instead.
Thats what i've done. All blocks i've used are from the Blocks Catergory
Still am not able to get it working, if you still think this is an error by me feel free to check to my procedure:
https://imgur.com/a/lRf0nOA
Can you show a picture of your GUI?
GUI: https://imgur.com/a/HXji8N9
The problem in your procedure seems to be that Dryness is never bigger or equal to 50. Nothing inside of that if statement will ever play as the first if statement always returns false.
There are mainly 3 type of variables that you need to know of:
Global variables, NBT tags, local variables.
A lot of people accidentally use local variables where they should be using NBT tags. Local variables ONLY exists for the lifetime of the procedure call, meaning that after the procedure finishes, the value is gone. In your procedure case: Dryness local variable is always 0, then 1 (procedure ends) 0, then 1, (procedure ends) etc. Use a block NBT number tag and call it dryness instead.