Minecraft how to testfor if a mob is looking at the player

Minecraft how to testfor if a mob is looking at the player - A Smartphone Game Controller On A Person's Hand

Is there a way I can testfor if a mob is looking at the player? I know there is a way to testfor a certain rotation, but is there a way to test if the mob is looking in the general location of the player?



Best Answer

if using MC 1.8 you can summon an armorstand acording to the lets say Zombie's position and direction then test to see if the player is within the range (3 maybe?) of the armorstand




Pictures about "Minecraft how to testfor if a mob is looking at the player"

Minecraft how to testfor if a mob is looking at the player - A Basketball Player Posing with a Medal and a Trophy
Minecraft how to testfor if a mob is looking at the player - A Man in Black Shirt Holding a Ball
Minecraft how to testfor if a mob is looking at the player - A Man Playing Tennis



How do you detect if a player is looking at a mob in Minecraft?

detectPos is the x y z coordinate to detect the block. command is any Minecraft command that you want the entity to execute such as summon, give, fill, clone, setblock, tp, xp, kill, etc.



How to detect where the player is looking at in minecraft pe




More answers regarding minecraft how to testfor if a mob is looking at the player

Answer 2

there is no command combination/singular command that can't do that. yet.

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Joseph Redfield, RODNAE Productions, Alesia Kozik, RODNAE Productions