How can I raycast / check if an entity is not obstructed

Started by znibsss on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I raycast / check if an entity is not obstructed

In my mod, I have a turret entity that looks at a hostile mob and damage it if in range of the turret. The problem is that right now it damages the entities even if they are behind a wall. How can I raycast / check if the entity is visible relative to a position?