![]() This concept can also be used to do something every x times something happens. So at the end of your command block chain or ticked function, you put this: execute if score $timer timer matches 100 run scoreboard players set $timer timer 0 ![]() If you want to repeat something every x seconds/minutes/…, you can just reset the timer after you have done whatever you want to do with it. If you want a variable starting time, compared to someone else's score, you can for example use >= points instead of matches 100. ![]() If you want to do something repeatedly after 5 seconds, simply replace 100 with 100. Now you can do something once the timer reaches your desired number of ticks like this: execute if score $timer timer matches 100 run say 5 seconds are over! If you do not want it to show up in a scoreboard sidebar display, start the name with a # character. The name " $timer" cannot possibly be a real player name, so it is a good choice for a dummy player name. In a repeating command block or ticked function, execute this command: scoreboard players add $timer timer 1 The " dummy" type is one that is not affected by anything except commands. This needs a little bit more resources, because it actively does something every tick, but it shouldn't cause noticeable lag.Īs a preparation, you need a scoreboard: /scoreboard objectives add timer dummy If you cannot or do not want to use functions or /schedule, you can still use the old scoreboard timer method. Usually you'll want to do this under some condition, so that it doesn't keep looping forever. To loop execution, you can simply use the /schedule command at the end of your function. If you want to replace all existing schedules of this function with the current one, you can use replace or just provide no mode at all, replace is the default. If you want to schedule multiple executions, you can use append instead of replace. If you have changed your mind, you can abort a scheduled function execution like this: /schedule clear abc:test The in-game days unit is not affected by sleeping or /time. So if you for example want to execute the function named "test" in the namespace "abc" in 1 hour, which equals 3 in-game days, you can use any of these commands: /schedule function abc:test 3d You may notice that is will above your desired limit of 600 ticks :)ĮDIT Just edited the above explanation to clarify between game ticks and redstone ticks a bit better.For functions there is a built-in way to do this: /schedule function That means 320 * 4 * 2 = 2560 ticks is the maximum pulse length for such a design. ![]() Even better, if you have two hoppers facing into each other, then you can double the output length by waiting for the items to leave the second hopper after first waiting for them to leave the first hopper. A hopper takes 4 redstone ticks to move an item, and you can have up to 5 stacks (320 items) in a hopper. So most long-duration timer circuits will use hoppers and comparators for timing. That's much smaller than 150!īut 20 fader circuits is still quite a bit. So you could chain 20 of those together to get your 600 tick delay. The slowest 2-comparator pulse extender (that is, two comparators next to each other, facing opposite directions, with redstone dust on their 4 inputs and outputs) will last 3 seconds, or 30 redstone ticks. A repeater can create a delay of up to 4 ticks, so you'd need 600 / 4 = 150 repeaters if you wanted to do it the simple, cheap, and naive way.ġ50 is a lot, so I'd recommend you use a different method. So 60 * 10 = 600 ticks of delay is what you need. 1 minute is 60 seconds, and 1 second is 10 redstone ticks (which, confusingly, are each 2 game ticks long, but that's not really relevant to this thread). (#spoiler) = neat! (/rose) = ( full list) News Builds Gameplay Maps Tutorials Redstone Command Blocks FanArt Comment Formatting
0 Comments
Leave a Reply. |