How do you use the testfor command to detect if a player has a certain score?!

I tried,

/testfor @a [score_A_min=10]

but it says, "expected '{' as first char".

| improve this question | | | | |

Short answer, you have an extra space where none should be

/testfor @a[score_A_min=10]

Long answer, the syntax for testfor is

/testfor <player> [dataTag]

where <player> is required and [dataTag] is optional. More importantly dataTag is not the target selector argument (which you are trying to use), but a compound NBT tag, which is indeed contained in {}, e.g. {XpLevel:3}.

The target selector argument has to follow the target selector immediately without a space in between, like this

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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