Im looking for a way to test if an entity is at a player's coordinates.

I've tried

/testfor @e[type=Shulker,name=Code] @a[r=1]

But it gives this

Data tag parsing failed: Invalid tag encountered, expected '{' as first char.

1 Answer 1


You should use /execute to have the command executed from the player rather than the command block:

/execute @a ~ ~ ~ /testfor @e[type=Shulker,name=Code,r=1]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .