Started by
gustavowizard123
on
Topic category: User side tutorials
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!
Yea, wondering too!
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.
D:
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 ;)
This tutorial could help: https://www.youtube.com/watch?v=VXAPH0g9A00&t=0s&index=3&list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei