To use it place the file in .minecraft / saves / the folder of your world / generated / minecraft / structures and then you can use structure blocks to create it (the name of the structure is fether_timer).
To set the time go to the "configuration" red command block on the left and change the "Fuse:" nbt tag to the number of ticks you want the timer to last (1 tick=1\20 second) and then press the button on the yellow "start" command block. When you press it the countdown starts. When the time is up the "output" command (or any other mechanism you want to attach) will get triggered. For example if the "Fuse" attribute is set on "80" (the standard for the tnt blocks) the timer will last 4 seconds. DON'T delete the Fuse attribute nor change it to a number under 2 ticks since the redstone circuit will be messed up and won't reset anymore. If you don't want the structure to be here anymore you can delete it with the purple "delete" command on the back.
how it works
This mechanism is based on the Fuse attribute of the TNT summoned by the "configuration" block (the red one) thanks to the torch placed from the "start" block (the yellow one). This torch activates also the repetition command block which continues testing for the TNT as long as the torch is here and when it cannot find it anymore a comparator attached to the command block stops the signal. Then a torch attached to the comparator triggers both the command block to replace the first torch with air to reset the mechanism, and the "output" command block (the green one). the obsidian structure is made so the TNT can blow up inside of it without causing damage to the structure nor the environment. The "delete" command block will just fill the space with air to get rid of the entire structure. You can see the mechanism from the glass above the structure or by carefully accessing it.
NOTE: the TNT gets summoned with the name "timer" so it doesn't despawn and the command blocks know which TNT keep under control.
PROs and CONs
cons:
handling TNT is always dangerous. Be careful! (I messed up more than once while building it).
it is not tick-perfect since circuits and command blocks require some ticks to work. The more things you add to it, the more lag you'll have.
it requires a bit of space
it works only for at least 1.13 as it uses the new /execute syntax (I'm working on the 1.12 version).
pros:
super useful for servers
works on vanilla worlds
very precise
easy to use
more compact than almost any other kind of timer
you can make it last as long as you want
ATTENTION: I'm new around here so if I posted this in the wrong place or something please tell me
I don't know if this has already been made but I want to share it anyway, I spent time on this, I hope someone find it useful <3
MY OWN PRECISE TIMER BASED ON TNT AND COMMAND BLOCKS!
download
fether_timer.nbt
To use it place the file in .minecraft / saves / the folder of your world / generated / minecraft / structures and then you can use structure blocks to create it (the name of the structure is fether_timer).
if you don't know how to use a structure block, read this guide on what are the structure blocks.
instructions
To set the time go to the "configuration" red command block on the left and change the "Fuse:" nbt tag to the number of ticks you want the timer to last (1 tick=1\20 second) and then press the button on the yellow "start" command block. When you press it the countdown starts. When the time is up the "output" command (or any other mechanism you want to attach) will get triggered. For example if the "Fuse" attribute is set on "80" (the standard for the tnt blocks) the timer will last 4 seconds. DON'T delete the Fuse attribute nor change it to a number under 2 ticks since the redstone circuit will be messed up and won't reset anymore. If you don't want the structure to be here anymore you can delete it with the purple "delete" command on the back.
how it works
This mechanism is based on the Fuse attribute of the TNT summoned by the "configuration" block (the red one) thanks to the torch placed from the "start" block (the yellow one). This torch activates also the repetition command block which continues testing for the TNT as long as the torch is here and when it cannot find it anymore a comparator attached to the command block stops the signal. Then a torch attached to the comparator triggers both the command block to replace the first torch with air to reset the mechanism, and the "output" command block (the green one). the obsidian structure is made so the TNT can blow up inside of it without causing damage to the structure nor the environment. The "delete" command block will just fill the space with air to get rid of the entire structure. You can see the mechanism from the glass above the structure or by carefully accessing it.
NOTE: the TNT gets summoned with the name "timer" so it doesn't despawn and the command blocks know which TNT keep under control.
PROs and CONs
cons:
pros:
ATTENTION: I'm new around here so if I posted this in the wrong place or something please tell me
I don't know if this has already been made but I want to share it anyway, I spent time on this, I hope someone find it useful <3
Sincerely yours,
Fether.