How can I make an entity shoot a projectile at it's target ONLY if the target is not reachable?

Started by The Very Expir… on

Topic category: Help with modding (Java Edition)

Last seen on 23:45, 17. Apr 2024
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I make an entity shoot a projectile at it's target ONLY if the target is not reachable?

I'm trying to make a boss that both has a melee attack and also shoots projectiles when the target is far away enough, but when I enable projectiles, it just shoots them regardless of how close or far away it is. The target can literally be 2 block away and it will still shoot projectiles. Is there a way to achieve this?