TransWikia.com

How do i test for an entity relative to a player

Arqade Asked on March 7, 2021

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.

One Answer

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]

Correct answer by SirBenet on March 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP