So what is happening is Im trying to use the facing in execute to detect if someone is looking at a player for a project but It works o single player worlds but not servers for some reason IDK why and it's really annoying to
Comments 7
If it's only working on a single player, it's likely you're using the wrong selector (@s, @p, etc) for your situation.
In the future, I'd recommend posing your issue on a command block/ datapack help forum rather than making a bug report since it's likely an issue with your command logic rather than a bug.
Tristan its not that because I already checked for that it's that it isn't checking if the player is facing what I am telling it to I also tried the same command on a Single player world it works fine if but if I try on on multiplayer world it runs the command even if I'm not looking at the entity Im suppose to be looking at to run it
Can you please provide the exact command you're using along with proper steps to reproduce the issue?
Sorry it took so long I was busy with finals then forgot about this thing but here is the command (btw its also no long working in survival for my) /execute at Yourusername as Yourusername positioned ~-2 ~-2 ~-2 anchored eyes facing entity @e[type=minecraft:zombie,name=Bob,limit=1,dx=4,dy=2,dz=4] eyes run say Hi
Make sure to name the zombie Bob
execute facing
does not check if an entity is facing in a particular direction. Instead, it runs as if the entity is facing that direction. In your case you are running the command is run while facing the zombie, Bob, which has no impact on the output of the command. This command will always succeed so long as Bob is loaded and is within the volume specified.
In order to do this properly, you will need a predicate (and a command block or data pack, since this is too long to type in chat):
/execute as Yourusername at @s positioned ~ ~-1 ~ if predicate {"condition":"entity_properties","entity":"this","predicate":{"type_specific":{"type":"player","looking_at":{"type":"zombie","nbt":"{CustomName:'\"Bob\"'}","distance":{"x":{"min":0.0,"max":2.0},"y":{"min":0.0,"max":1.0},"z":{"min":0.0,"max":2.0}}}}}} run say Hi
I have tested that this works, and I assume it should be identical to what you were intending to do.
Please provide the exact command you're using.