How can I fix "expected '{' as first char" in my testfor command?
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".
Best Answer
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
@<variable>[<argument>=<value>,<argument>=<value>,…].
Pictures about "How can I fix "expected '{' as first char" in my testfor command?"



What replaced the Testfor command in Minecraft?
The /testfor command became obsolete in Minecraft 1.13, and has been replaced by the /execute command*. It will do the same as typing /testfor @e {SelectedItem:{id:"<item>"}} and then putting a comparator to the command block with the command, and then running the command which you wanna run.How do I use the Testfor player command?
How to Enter the CommandFix ; Expected (Semicolon Expected) Error in Unity
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Designecologist, RODNAE Productions, Andrea Piacquadio, Anna Tarazevich
