This question already has an answer here:

I am making a hide & seek scoreboard countdown for a friend of mine's hide and seek game. I want to ask how do you use /execute to test if an entity’s scoreboard is equal to 0?

I have an armour stand with a score that goes down by 1 every second, so I wanted to make it so that it runs a command when the score equals 0.

marked as duplicate by Virusbomb, Ivo Coumans, Gigazelle, Dragonrage, arghtype Oct 7 at 23:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You can use /execute if to perform a command if score matches 0 using the following:

/execute if score <target> <targetObjective> matches 0

Note that if you want the opposite - a command to run when a score does not match 0, you would use /execute unless, i.e.

/execute unless score <target> <targetObjective> matches 0

You can read more about /execute on the Minecraft Wiki

Not the answer you're looking for? Browse other questions tagged or ask your own question.