1
Please Help
I want to be able to use a /testfor command, but it gives the same message no matter what I try. I will enter this
/testfor <my username, not telling...> {r=5}
I want to be able to detect myself in a 5 bloc radius but it tells me
Data tag parsing failed: Unable to locate name/value separator for string: r=5
Can someone help me?
/testfor <my username, not telling...> {r=5}
I want to be able to detect myself in a 5 bloc radius but it tells me
Data tag parsing failed: Unable to locate name/value separator for string: r=5
Can someone help me?
Create an account or sign in to comment.
9
1
Thanks, Bertiecrafter! I can now make a proximity detector for my security system!
1
The correct command is:
/testfor @a[name=username,r=5]
1
I don't get why you are repeating what is already said. I did repeat someone else, but he quickly posted the solution as I was writing a bigger comment.
The order of the arguments doesn't matter in the command.
The order of the arguments doesn't matter in the command.
1
r=5 is a target selector argument, it describes WHERE to look for.
name=(...) is another target selector argument for a specific name.
@a detects everyone, it's the (main) target selector.
DataTags are combinations of keys and values, they describe WHAT a certain entity is.
There are target selector arguments that describe WHAT to look for, but they are also obtainable using DataTags. (For example the amount of xp levels).
Here are commands that would work:
/testfor @a
/testfor username
/testfor @a[r=5]
/testfor @a[r=5,name=username]
But this won't work (as far as I know):
/testfor username[r=5]
Because I think that you can only use the arguments with @a(everyone), @p(nearest players), @e(all entities) and @s(command executer).
Feel free to look at one of my blogs to learn more about how to do commands. (C|T series)
name=(...) is another target selector argument for a specific name.
@a detects everyone, it's the (main) target selector.
DataTags are combinations of keys and values, they describe WHAT a certain entity is.
There are target selector arguments that describe WHAT to look for, but they are also obtainable using DataTags. (For example the amount of xp levels).
Here are commands that would work:
/testfor @a
/testfor username
/testfor @a[r=5]
/testfor @a[r=5,name=username]
But this won't work (as far as I know):
/testfor username[r=5]
Because I think that you can only use the arguments with @a(everyone), @p(nearest players), @e(all entities) and @s(command executer).
Feel free to look at one of my blogs to learn more about how to do commands. (C|T series)
1
Thanks, I will try this.
1
try this: /testfor @e[name=<YourNickname>,r=5]
1
I tried it just now, but now it says this:
Data tag parsing failed: Invalid tag encountered, expected '{' as first char.
What I wrote was /testfor <*my name*> [r=5]
Data tag parsing failed: Invalid tag encountered, expected '{' as first char.
What I wrote was /testfor <*my name*> [r=5]
1
you are supposed to type it like this:
/testfor <name>[r=5]
/testfor <name>[r=5]
1
Thanks, I will try it.