SOLVED: Saving progress inside a GUI

Started by lamon_damon on

Topic category: Help with modding (Java Edition)

Last seen on 13:16, 11. Oct 2024
Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
SOLVED: Saving progress inside a GUI
Thu, 08/08/2024 - 15:47 (edited)

Hello! I wanted to make a new table that when right clicked, it opens a GUI, in said GUI there's 2 slots, one is an input one and the other is output, in the input you put coal, specifically only a stack of coal, no more, no less, and 1 minute it should transform into a custom item. I have done this entire process, but when I exit the table, nothing saves, you have to re-put the stack of coal because it just deletes it, and the 1 minute timer restarts, if anyone knows how I can save that time when you exit the GUI, it would be extremely useful! Thanks!

Edited by lamon_damon on Thu, 08/08/2024 - 15:47
Last seen on 16:02, 10. Oct 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
have you used a block NBT…
Wed, 08/07/2024 - 16:23

have you used a block NBT tag to make the timer? and have you bound the GUI to the block in it's settings?

Last seen on 13:16, 11. Oct 2024
Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I did bound the GUI to the…
Wed, 08/07/2024 - 17:20

I did bound the GUI to the block, but I don't understand the NBT part of everything, I don't understand how it works, I was thinking that's the problem...

Last seen on 16:02, 10. Oct 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
set the tick rate of the…
Wed, 08/07/2024 - 17:26

set the tick rate of the block to 1 and then on block tick update (can be found in the triggers tab) you make a timer with NBT like I showed in this forum topic: https://mcreator.net/forum/109093/how-make-loop-procedure  

you just have to use block NBT instead of entity

Last seen on 13:16, 11. Oct 2024
Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm so sorry that I have to…
Wed, 08/07/2024 - 17:54

I'm so sorry that I have to make this longer than it should be, but there isn't a On Block Tick Update in the triggers menu, nor in the procedure event trigger when I go to the block's triggers section with the gui

Last seen on 16:02, 10. Oct 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Maybe you don't find it…
Thu, 08/08/2024 - 01:13

Maybe you don't find it because it is just called "on tick update", not "on block tick update"? I know very well that it exists

https://imgur.com/OkbSSMD 

Last seen on 13:16, 11. Oct 2024
Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok, I made the code provided…
Thu, 08/08/2024 - 12:25

Ok, I made the code provided in the first image, in the On Update Tick trigger from the second image, but it still doesn't seem to work, since the trigger doesn't allow me to select that procedure saying that it has missing dependencies, my code is the exact same, other than the absorption given, any idea why this is happening?

Last seen on 16:02, 10. Oct 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
did you use block NBT tags…
Thu, 08/08/2024 - 12:36

did you use block NBT tags instead of entity NBT?

Last seen on 13:16, 11. Oct 2024
Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Omg, you're right, I did use…
Thu, 08/08/2024 - 12:54

Omg, you're right, I did use entity NBT's, so sorry for the mistake! I actually went in the game and the progress on the gui still doesn't continue after you exit the gui, so it might be the code that I made for that progress - https://imgur.com/a/6k4hdMI - this the the code of the gui "While this GUI is open tick", and there's another code that opens this gui when the block is right clicked, but it still doesn't save the progress once you start it

Last seen on 16:02, 10. Oct 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
instead of the wait ticks…
Thu, 08/08/2024 - 13:15

instead of the wait ticks blocks you should use the timer I showed you before, put that whole procedure on the tick update trigger too, and instead of checking slots using "currently open GUI by event/target entity" use this block: https://imgur.com/3t966rH 

 

and you should delete the procedure that opens the GUI on right click since you already bound it to the block

Last seen on 13:16, 11. Oct 2024
Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
From what I could process,…
Thu, 08/08/2024 - 13:28

From what I could process, is the code supposed to look something like this? I might've gotten it completely wrong though https://imgur.com/a/Gq2M9mz

 

Last seen on 16:02, 10. Oct 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think that this is too…
Thu, 08/08/2024 - 14:09

I think that this is too complicated to explain in text (in fact I forgot some things), It's easier to just do it myself: https://imgur.com/6BxRqL3 slot 0 is the input one and slot 1 is the output one, replace the slab with your custom item, set this to "on tick update" and that's it

Last seen on 13:16, 11. Oct 2024
Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just to be sure, this code…
Thu, 08/08/2024 - 14:18

Just to be sure, this code goes in the block's update on tick trigger, or the GUI's one?

Last seen on 16:02, 10. Oct 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
block
Thu, 08/08/2024 - 14:20

block

Last seen on 13:16, 11. Oct 2024
Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
when I put the items in the…
Thu, 08/08/2024 - 14:28

when I put the items in the first slot, nothing happens now, it just stays there or goes back in my inventory when I close the GUI