How to check if an entity cannot reach the player?

Started by BanjoChicken69 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to check if an entity cannot reach the player?

Hey, so im making a mob that is meant to be outsmarted instead of just allowing the player to run away, and i want to know if there's a way to check if the entity can't get to the player. I've noticed that because the entity is 3 blocks tall, there's a lot of ways to just walk under an awning and dig away, and I want it to be able to continue to chase you or atleast summon something to bring you towards it.

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you're ok with your…
Fri, 09/29/2023 - 17:27

If you're ok with your entity teleporting, you can try something like, if attack target does not equal null, then if attack target is not within 10 blocks, teleport to random xyz near attack target.

You can also change the follow distance and whether the mob will still chase the target if they can't see it in the AI settings

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Stitch147 Could you…
Fri, 09/29/2023 - 22:44

@Stitch147 Could you possibly provide an image or explain more in depth?