Minecraft – Execute and Fill Command Block

minecraft-commandsminecraft-java-edition

What would be the correct command to place a redstone torch at 1043 58 982 when the timer starts at 20 and remove it when the timer reaches 0 in the 1.14.2 version of Minecraft.

I think this would most likely use two different command blocks.

So far I've made a timer that starts at 20 and a Times_Up objective that equals 0.

This is the best I could come up with in a repeat command block that is always active:

/execute if score Timer Timer > Times_Up Times_Up run fill 1043 58 982 1043 58 982 minecraft:redstone_torch

Best Answer

You can trigger this command at the same time as you trigger the timer, probably by using a chain command block:

/setblock 1043 58 982 minecraft:redstone_torch

It will place a redstone torch at the specified coordinates. If it isnĀ“t possible for you to trigger any other command at the same time as you start the timer, then you can use this command in a repeating command block instead:

/execute if score Timer Timer > Times_Up Times_Up run setblock 1043 58 982 minecraft:redstone_torch

You can use this command to remove the torch if the time is up:

/execute if score Timer Timer <= Times_Up Times_Up run setblock 1043 58 982 air