Setting up a timer in procedures (Like an event that triggers every 10s)

Started by AgentBurrito on

Topic category: Help with modding (Java Edition)

Last seen on 00:54, 17. Feb 2022
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Setting up a timer in procedures (Like an event that triggers every 10s)

At the moment I have only found a way for an event to be triggered regularly is by using the world tick procedure block, which is too often and causes lag. Is there a way to use procedure blocks to create a regularly triggered event with a more usable time?

Last seen on 02:03, 12. Jul 2024
Joined Apr 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I believe you would need…
Sun, 02/13/2022 - 16:57

I believe you would need something like this:

procedure image

Note that the "200" here is the amount of ticks to pass and you can adjust that to whatever amount you wanna count. 200 ticks is 10 seconds.

Also note that you have to use a GLOBAL_WORLD variable for this, local won't work as that's reset every time the procedure executes.