is it possible to have a timer that continues counting after i leave and rejoin the world? (Cont in body)

Started by MaxIfHeWasinMi… on

Topic category: Help with modding (Java Edition)

Last seen on 02:25, 22. Jul 2024
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
is it possible to have a timer that continues counting after i leave and rejoin the world? (Cont in body)

 and for it to remember what item was related to the timer?

Ok, so basically im making a drying rack that works like a campfire, but longer and makes dried food ( who would've thunk), the issue is that if i were to leave and rejoin the world, its stuck in the drying phase and wont revert back unless broken, what i need to know is can i have a timer that will either restart or continue upon a player re-entering a world and if that's possible for it to remember what item its drying after i rejoin.

 do note the block in question does spawn particles at a 50 tick rate so i cant do upon update tick.

I've tried: Blockstates: Nbt tags: Local variables (by having all drying code in one procedure), and global variables wouldn't work and would break this

if only there were semi global variables, that would be global but only for that block.

any help is great! thanks!