Problem with testfor command: "expected '{' as first char"

Problem with testfor command: "expected '{' as first char" - From above chalkboard with THERE COMES A TIME WHEN SILENCE IS BETRAYAL inscription on black background

I am making an adventure map but I have a problem.

For the testfor command I put /testfor @p [r=3] but it doesn't work.

The command block says:

[13:13:15] Data tag parsing failed: Invalid tag encountered, expected '{' as first char. 

I am using Minecraft version 1.8.8.



Best Answer

The Syntax is just a little bit wrong here's yours:

/testfor @p [r=3]

The Correct One:

/testfor @p[r=3]

Side Note: If your using /testfor @p[x=1,y=1,z=1,r=1] with negative numbers, it won't work.




Pictures about "Problem with testfor command: "expected '{' as first char""

Problem with testfor command: "expected '{' as first char" - Young frowning man in suit and glasses looking at wristwatch while waiting for appointment sitting at desk with laptop
Problem with testfor command: "expected '{' as first char" - Message Against Bullying
Problem with testfor command: "expected '{' as first char" - Text Printed on Handmade Paper



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 Command
  • Test if Players are within 10 blocks. In this example, we will test to see if there are any players within a 10 block radius with the following command: /testfor @a[r=10] ...
  • Test if Mooshrooms are within 50 blocks. ...
  • Test if Nearest Player is at Level 20 experience.




  • Comparator Testfor Problem fix




    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Brett Sayles, Andrea Piacquadio, RODNAE Productions, Karolina Grabowska