Check if player is looking at entity

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Username here

Member
Aug 12, 2025
1
0
1
I'm trying to check if the player is looking at an entity when they right click, yet target entity or any other variations seem to not be working at all or only work if I'm right next to them is there another way to do this or fix target. Minecraft 1.21.11 and Skript 2.15.3 (also I'm relatively new to Skript so sorry if it's an obvious fix.)
 
Not sure if this would be helpful but to increase the range, you may have to use a little bit of math. If you could draw an imaginary line from the player's view to the entity and get the entity, that would work. However, you'd still need to figure out how you would code something like that in Skript (There may or may not be a way to do this).