Mojira Archive
MC-198068

Some entities randomly stop attacking or fleeing during pathfinding

The Bug:

Whilst a melee-type mob pursues a player/entity, they may stop attacking once in a while when pathfinding towards their targets. This is also an issue with certain passive mobs as certain passive mobs (e.g. a villager) may randomly stop fleeing for a second if a player hits that entity. (This issue is just like the MCPE counterpart, MCPE-48144).

Affected Entities:

Please note that there may be more entities affected by this issue that aren't listed below.

  • Cave Spider
  • Creeper
  • Enderman
  • Endermite
  • Iron Golem
  • Silverfish
  • Skeleton (without bow)
  • Spider
  • Stray (without bow)
  • Villager
  • Vindicator
  • Wither Skeleton
  • Wolf
  • Zombie
  • Zombie Villager
  • Zombified Piglin

Steps to Reproduce:

  1. Summon any of the affected mobs listed above.
  2. Provoke it if necessary and allow the said entity to attack you.
  3. Observe how sometimes, the entity randomly stops and starts pathfinding even though it hasn't made it to its target.

Observed Behavior:

Entities stop and start pathfinding at random intervals even though they haven't fully approached their target. This happens randomly and can last several seconds before it starts to pathfind again.

Expected Behavior:

Entities would not stop and start pathfinding at random intervals when pursuing their target.

Code Analysis:

Code analysis by Chumbanotz can be found in this comment.