mojira.dev
MC-150839

Panicking entities that end up in locations relatively far from where they received damage, will sometimes choose to pathfind to the location of where they were damaged at

The Bug:

Panicking entities that end up in locations relatively far from where they received damage, will sometimes choose to pathfind to the location of where they were damaged at.

When cows, sheep and pigs are hit by a weapon enchanted with Knockback while they are walking to a specific location, they do not update their pathfinding. They will continue to move to the location they were originally pathfinding towards.

This is easier to see if the mobs are hit by a weapon enchanted with a high level of Knockback. This was reproduced easily with Knockback 20. This level of Knockback will knock most mobs about 50 blocks.

To reproduce:

Create a superflat world in creative mode.
Enchant a stick with Knockback 20, command is:

/give @p minecraft:stick{Enchantments:[{id:"minecraft:knockback",lvl:20s}]}

Find or spawn a cow, sheep or pig.

Wait until the mob is walking on its own to a new location.
Hit it with the Knockback stick. -> The mob will run towards the player, towards where they were originally going. They will run in a straight line for 50 blocks or so. It won't happen all the time but will happen fairly often.

Linked issues

Attachments

Comments 7

Affects 1.15 prerelease 2.

Affects 1.16 pre 3. It is easiest to replicate in a superflat world with cows, pigs and sheep.

When the affected mob is hit with a knockback weapon while it is walking, it will walk or run back to the point where it was pathfinding to. It also turns after being hit while flying through the air to face that point.

Can confirm in 20w51a.

Can confirm in 1.16.5, added a video showcasing because my report was a duplicate. The video was filmed with a fabric loader but tested after on 1.16.5 vanilla and exact same results. Here is my duplicate that could have more information. MC-226963

I've updated this ticket to mention the core problem here.

bdm68

(Unassigned)

Confirmed

Mob behaviour

Minecraft 1.14, 1.16 Pre-release 3, 20w51a, 1.16.5, 1.19.4, 1.20.1

Retrieved