Delay betheewn events

Started by gustavowizard123 on

Topic category: User side tutorials

Last seen on 19:53, 2. Jun 2021
Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Delay betheewn events

Hi guys!

So im trying to make something simple, like a delay betheen commands; for example:

 

Condition: Have a Diamond on the hand

Stack Event: Consume Item in Invetory (diamond); Remove Block (i,j,k); DELAY (???); Add a Block(i,j,k)

what command i give to Command lines, to make a delay (like the lua 'sleep')

 

thanks!

Last seen on 00:18, 26. Mar 2022
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yea, wondering too!
Mon, 03/05/2018 - 02:15

Yea, wondering too!

Last seen on 20:19, 16. Apr 2020
Joined Jan 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Programs don't run like that…
Sat, 03/31/2018 - 10:39

Programs don't run like that anymore. I believe that won't be possible due to how Java works as in Object Oriented programing. In the older programing languages that ran sequentially like Basic when the code was executed line by line you could easily trap the program in to a loop, however now with programs running events that just can't happen.

If I'm incorrect please let me know.

However if you watch carefully I believe the events are done sequentially. You could set it up in a way that one event happens then a condition where a Variable VAR:XX is incremented in an event that is triggered by the previous event. When the VAR:XX reaches that number it triggers the second event. You'll need to reset that variable to 0 after.

If there was a way to track the Minecraft tick I would set a variable to the tick value at that time and a event to go off after a set of time or ticks have gone by. But to actually delay or stop an event before being able to proceed and exit in my opinion is not possible or might even set off an error.

Last seen on 00:18, 26. Mar 2022
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
D:
Sun, 04/01/2018 - 18:21

D:

Last seen on 03:46, 28. Aug 2019
Joined Mar 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I sometimes use a Global…
Sun, 06/24/2018 - 14:21

I sometimes use a Global Variable then on a Event (example: Death of mob) I add the line to minus it by 1, then have a If statement looking for the value you want. Works either way with the minus or plus. Only problem that I can think of is it is a Global variable so may or may not affect other things (depending on its use). Hope it helps in some way ;)