Help with how to check if there is a block between entity and player

Started by Pdubbs_ on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with how to check if there is a block between entity and player

I am having trouble figuring out how to make the game do something when the player has line of sight with an entity.
My code works when i am looking at the direction of the the entity and still works when looking at its direction through a solid block.

I need it to only work when looking through glass.

Joined Apr 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey Sin Costan, you might be…
Sun, 05/24/2026 - 23:50

Hey Sin Costan, you might be my savior.

I really need a code to do this, but this link doesnt work anymore.

If you still have the procedure or the print, do you mind sending it again?