Timeout / World Clock Math Condition Procedure.

Upvotes: 2
Issue description

Timeout Delay

In the future update could we have a timeout delay procedure for math condition. What it would do is have a count down timer based on game ticks before it can proceed to run the event in say an if statement. This could delay procedures for a time without needing to use a randomizer that is not a guarantee that it will be on time before the procedure will run the next time. You could use this with potion effects to deal damage to an item or armor for the same exact time as the time it takes for the potion to just about run out.

 

Real / Minecraft World Clock Delay.

The other one is a World clock delay. The same idea but rather than setting a tick for a delay to have it based on Minecraft world time. It may also be good to have a real world clock delay too. You could use this to run a procedure every night at say 6 pm in Minecraft if the block is placed in the world. This could be from everything to change the weather to raining too, strike lightning at the block which could be used to make zombie pigman and so on.

 

Why Randomizers Don't work great for delays.

Randomizers are hard to control the delay and can be hard to predict if the random chance will be on time for say a potion effect to be readded before it runs out due to it being random. Using a delay rather than a randomizer would fix this issue. It currently is not possible delay things for every night or specific time which restricts things when setting up more advanced mods like the lightning idea I just mentioned under World Clock Delay. This would open more doors for mods that require advanced procedure with delays.

Issue comments

Submitted by Klemen on Tue, 06/25/2019 - 08:55

Most of these can be done using tick events and variables.

For the player: use NBT entity tags to store counter value per player and increment the counter each tick event on players tick, which is a global trigger.

For items and blocks, you can use block variables and item variables (coming in 1.9.0) to count the value

After you reach a certain value, do something and reset the counter. Tick events happen each tick or at a given rate of ticks for blocks.

For the real world clock delay, I will add a procedure get the current time that will return time as a number so you will be able to check for the current time.

For world global timers, you can use global variables to achieve this, but there is no true global tick event yet in MCreator, but we will try to find a way to add this too.

Submitted by Klemen on Tue, 06/25/2019 - 09:52

Get world time and world tick global procedure triggers will be added in 1.9.0.

Submitted by JRGlitches on Tue, 06/25/2019 - 17:38

Praise JESUS this was added, so helpful!