Change variable when player looks at specific entity

Started by dniproman on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Change variable when player looks at specific entity

Hello, so I want to change a globle variable when thhe pllayer looks at my custom entity. I know how to set variables but I don´t really know what I should use for raytracing entities. I tried it with: Does entity exist at X: Look Position X of Event/target entity with raytrace distance 100. I have done the same for Y and Z. "The Does entity exist in" is set to: in square cube with size 2 of type (my custom entity). The problem is that it doesn´t work when looking at my entity but when looking at the block the entity stands on. What can I do to fix this?