Started by
Lionmeow
on
Topic category: Help with MCreator software
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
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 :)
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?
https://www.youtube.com/watch?v=VXAPH0g9A00&list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei&index=27&t=0s
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.
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.
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.
Did you call this procedure from the block update event?
Also you probably should have a something that stops the tickvar from continuing infinitely.
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?
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?
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.
Huh... I attempted the fixes, however it still will not work. It just stays, without placing the blocks.
Wait a second-- it's that glitch I experienced before. When I start the event, the entire world freezes. You can still move around and modify blocks, however mobs are frozen, and attempting to click on anything doesn't yield results. You can't reload or exit the game, as it freezes up as soon as you try to do so. Note that when I tried replacing the active core with the inactive one during the freeze up, then right clicked, while the block did change, nothing else happened.
lol same.but for me,is when i make change player to dimension id.
This can happen if one of your procedures gets called too often or you make a procedure that somehow triggers itself.