1

Please Help

DeltaGamer7246's Avatar DeltaGamer72466/22/17 1:00 am
1 emeralds 368 9
6/22/2017 7:09 pm
DeltaGamer7246's Avatar DeltaGamer7246
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?
Posted by DeltaGamer7246's Avatar
DeltaGamer7246
Level 1 : New Miner
0

Create an account or sign in to comment.

9

1
06/22/2017 7:09 pm
Level 1 : New Miner
DeltaGamer7246
DeltaGamer7246's Avatar
Thanks, Bertiecrafter! I can now make a proximity detector for my security system!
1
06/22/2017 2:27 pm
Level 8 : Apprentice Architect
MilkyRayy
MilkyRayy's Avatar
The correct command is:

/testfor @a[name=username,r=5]
1
06/22/2017 2:35 pm
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
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.
1
06/22/2017 1:06 pm
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
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)
1
06/22/2017 7:03 pm
Level 1 : New Miner
DeltaGamer7246
DeltaGamer7246's Avatar
Thanks, I will try this.
1
06/22/2017 1:06 pm
Level 69 : High Grandmaster Artist
oakar258
oakar258's Avatar
try this: /testfor @e[name=<YourNickname>,r=5]
1
06/22/2017 12:41 pm
Level 1 : New Miner
DeltaGamer7246
DeltaGamer7246's Avatar
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]
1
06/22/2017 3:57 am
Level 28 : Expert Pig
Dark_Alpha_
Dark_Alpha_'s Avatar
you are supposed to type it like this:

/testfor <name>[r=5]
1
06/22/2017 12:39 pm
Level 1 : New Miner
DeltaGamer7246
DeltaGamer7246's Avatar
Thanks, I will try it.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome