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.

Thanx in advance!


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]
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.