How to detect when any entity within a certain range is looking at the player?

Started by VezNilJack on

Topic category: Help with MCreator software

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to detect when any entity within a certain range is looking at the player?
Wed, 04/06/2022 - 22:22 (edited)

I want an effect to happen upon any living entity looking at the player, within a certain range of course. l've tried many methods already. Using entity head pitch/yaw along with a unnecessarily large amount of trigonometry, had no results. Using entity look x/y/z along with differential vectors and dot products, had no results. Attempting to use commands to circumvent the difficulty I had already experienced with this also failed, and when I attempted to come up with my own method (I had found the prior three on this form) that actually may have ended up working, the amount of math involved caused the game to crash instantly. Any solutions?

Edited by VezNilJack on Wed, 04/06/2022 - 22:22