A new "wait (delay) block" for procedures

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

Submitted by Goldorion on Tue, 07/31/2018 - 14:16

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

Developer Submitted by Klemen on Wed, 08/01/2018 - 17:11

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.

Submitted by FAKE1007 on Tue, 08/07/2018 - 17:14

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.

Developer Submitted by Klemen on Fri, 01/04/2019 - 15:41

This is indeed one of the solutions that work in current versions too.

Submitted by Goldorion on Fri, 01/04/2019 - 19:12

Thanks you for your help DiamondGamin.

Submitted by WeswePengu on Wed, 01/09/2019 - 03:53

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

Developer Submitted by Klemen on Sat, 02/23/2019 - 14:56

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.

Developer Submitted by Klemen on Tue, 07/02/2019 - 08:24

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.

Wiki contributor Submitted by Wes on Sat, 07/20/2019 - 23:06

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