A new "wait (delay) block" for procedures

Published by Goldorion on
Issue description

Hello,

I want to do a stopwatch in my procedures, but I do not know how to do it, because I can not find anything about the foirums, and I think it's just really complicated to make a minuesty for in a GUI. I vudrais therefore you ask to add a new "block" that would make it possible to wait x seconds before doing an action.

I was running a new "block" write wait "number of seconds to wait" seconds. I think, and I find that it would just be much too practical and useful, and easier / easier than just having to do I do not know how much different and complicated things to do and understand.

Thank you very much and in advance to add it for 1.8.0 of MCreator.

Goldorion

Issue comments

I just put you an image I made quickly, so that you really understand what I want you to add.

We have closed feature list for 1.8.0. Making delay block is not an easy task as Minecraft is single threaded. In many cases, it is even impossible. Most likely, this will have to be solved with counting ticks.

I think this may be possible if you make a variable (for example : tickvar) to 1 higher every tick. 20 ticks are equal to 1 real life second so this is possible with some maths.

 

Apply on every tick update and do

if bomb = item in enities main hand:

tickvar = tickvar + 1 

if tickvar > 60:
clear main hand

set tickvar to 0;

Hope this helped.

Really useful idea. I would also love to see some kind of official support for this.

Actual delay implementation as one single procedure block will not be possible unfortunately as the implementation of delay depends from case to case based on my tests. With the new implementation of variables (per block, per world: https://mcreator.net/tracker/issue/42990), this will be quite easy.

One just needs to use one of the new variable types and increase it each tick update. When the variable reaches the desired value, the actual event happens and the delay will be achieved.

The idea is similar to what DiamondGamin wrote a few comments above.

I've found out how to make a throwable bomb that also waits 3 seconds before exploding.

To make Delay just use NBT Tags so that they will be stored per block/entity

Wait is not just procedure but you need something to store count and tick trigger so really it is a combination that can not ba packed in a template. It depends on type of delay too, say block delay or entity based delay or global delay (timer).

This doesn't help with items. Items don't have an "update tick" block and I'm not sure of how to "apply on every tick update" as DiamondGamin mentioned above. I'm trying to make an item (weapon) that when right clicked, will make a series of explosions with delays between each.

Yeah I've tried a bunch of different things and I can't get it to work.

Try to use item NBT tags in combination with tick event. Search on forums here too and on YouTube, you might find some useful tips.

I've looked at the block delay video you've linked in a lot of threads. I have done the exact same thing except on item tick procedures (both of them, in inventory and in hand) and it doesn't work.

wouldn't it be amazing if it was possible so we didnt have to go through all that

 

Woah Woah, I just had an epiphany! So what if you could set it so that a certain entity gets a potion for however many seconds you require, and you add a repeat block to the big procedure you are delaying, and it will repeatedly ask if the potion is over on this one entity. Once the potion ends, then it will be able to run its procedure!