Started by
Saiber Rida
on
Topic category: Help with Minecraft modding (Java Edition)
So I made a block that is supposed to spread like grass, it would basically turn any block close to it into that block, think on it as some kind of "corruption", the problem is that making the procedure be triggered by random tick is not a good idea since it spreads way too fast, I need to make it spread reaaaaally slowly (otherwise the whole world would be corrupted in less than an hour)
World Random Tick doesn't work because of being too fast, but Update Tick ends up crashing the game, so, what could I do?
If it is to fast then why not create a timer so it ... doesn't tick to fast?
The problem is that I don't know how, and that 5:08 minutes long tutorial about block delay is not being helpful to me
Minecraft Tick == 20 seconds
Well, to put it simply. Create a variable that seems fit (We will call it to tick). Then we add onto tick every, tick. Once the timer hits a certain number we set it back to 0 and do what we need to do. I will include a few examples.
Keep in mind the example above is a year old, but if you like reading code here is an example I use in an EntityAI I created,
Now the code above I had to remove a lot of parts to highlight what was being done. I made this code a long time ago so some of it I have now learned to become unnecessary, for example, you don't need a "cooldownsave". You can just subtract from the cooldown until you get 0.
That's really it, I don't know what else I can do to help you. Just make sure that whatever method you use (they are all similar). Make sure that method updates every tick (just don't put it in an item click method, unless you want to make a counter which is also cool).
i want to make a block that spreads very fast can you pls give me the procedure of the first one