How might I make a sorta event that delays with procedures?

Started by Lionmeow on Fri, 08/02/2019 - 04:43

Topic category: Help with MCreator's application

Last seen on 20:48, 15. Sep 2019
Joined Feb 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
How might I make a sorta event that delays with procedures?
Fri, 08/02/2019 - 04:46 (edited)

I've been attempting for a bit now to make a block that does something when it's placed. So let's say that when the block is placed into the world, every five seconds, for fourty-five seconds, a zombie spawns around the block? How might I do the 'every five seconds for fourty-five seconds' thingy?

Edited by Lionmeow on Fri, 08/02/2019 - 04:46
Last seen on 20:18, 15. Sep 2019
Joined Jun 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
When you make the block,…
Fri, 08/02/2019 - 06:32

When you make the block, below the material of the block is the tick rate. 20 ticks = 1 second, just add it up to whatever time you want, then add a procedure to tick update, not random tick update event. Hope this helps :)

Last seen on 20:48, 15. Sep 2019
Joined Feb 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Hmm... while this does help…
Fri, 08/02/2019 - 07:12

Hmm... while this does help quite a bit, it does everything at once. I suppose I should have clarified that in the original post. What if I want to spawn a slime to the side of a block, and then a second later place a block above the block?

Last seen on 20:48, 15. Sep 2019
Joined Feb 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Unfortunately, from my many…
Sun, 08/04/2019 - 03:42

Unfortunately, from my many viewings of that video in the past, I have concluded it will not work for my situation. What I'm attempting to figure out is making many delays within the block. My idea is when said block is placed into the world, it places a couple blocks, waits a second, places more blocks, waits a second, spawns a mob, waits a second, etc., culminating in replacing the original block after 45 seconds.

Last seen on 19:50, 16. Sep 2019
Joined Apr 2010
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
  • developer
You can easily do this and…
Sun, 08/04/2019 - 09:37

You can easily do this and there are tutorials for this on forums. Just count to one value, do something, then count to next value, etc.

Last seen on 20:48, 15. Sep 2019
Joined Feb 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I honestly don't know what I…
Sun, 08/04/2019 - 10:40

I honestly don't know what I'm doing wrong. That was actually my first thought when first faced with this issue, and before I made this post, I looked around and found many posts saying similar things. I did my own idea too. Everything I try results in one of three things. Either it is instant rather than delaying, doesn't work at all, or just glitches out. Here's my code, I've tried on both tickupdate and randomtickupdate events, along with modifying the tick update speed, however nothing seems to be working.Snippet

Last seen on 17:53, 10. Sep 2019
Joined Nov 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Did you call this procedure…
Sun, 08/04/2019 - 17:36

Did you call this procedure from the block update event?

Also you probably should have a something that stops the tickvar from continuing infinitely.

 

Last seen on 20:48, 15. Sep 2019
Joined Feb 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I'm almost sure block update…
Sun, 08/04/2019 - 21:05

I'm almost sure block update event is Update Tick, is it not? If it is, then yes, I have called it from that event. About infinitely continuing with tickvar, won't it stop as the block updating it is being replaced? 

Last seen on 20:48, 15. Sep 2019
Joined Feb 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Well here's an update: I…
Sun, 08/04/2019 - 21:26

Well here's an update: I revamped the code, however as logical as it is, no delay occurs. I placed it in the 'When block placed into the world' event. Any ideas why this isn't working?AAAAAAA

Last seen on 19:50, 16. Sep 2019
Joined Apr 2010
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
  • developer
You can't use local variable…
Mon, 08/05/2019 - 11:29

You can't use local variable for delays as local is reset on each execution of the procedure, this is what local means.

Use one of the global variables types or NBT variables. You have examples on how to do this on the website, just search a bit.