A new "wait (delay) block" for procedures

Published by Goldorion on Tue, 07/31/2018 - 14:12
Upvotes: 11
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

Attachment Size
An image of what I want. My suggestion in an image.13.11 KB 13.11 KB

Issue comments

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.

Try looping and some useless blocks in it, like give potion effect nightvision for 0 seconds

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.

shadow_duck: Yes, you can make delays using a counter and one of the tick procedure triggers. Check the tutorial linked for one of the examples.

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.



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.