mojira.dev
MC-221754

Leashed wolves no longer attack when unleashed

Steps to reproduce in creative:

  1. Place fence post

  2. Spawn wolf with spawn egg

  3. Tame wolf with bone

  4. Use lead to attach wolf to post

  5. Right-click fence post (or move fence post using a piston) to release wolf

  6. Spawn cow

  7. Attack cow with empty hand

 

Expected behavior:

  Wolf attacks cow, and follows the cow if/when it runs away.

 

Observed behavior:

   Wolf will not attack the cow unless it is within the region the wolf could reach while leashed.

   Also, the wolf will not wander from that area, but can follow the player via teleportation.

Linked issues

Comments 4

Can confirm, and works for 1.17 pre-release 3

Another observation that I have made is that when you attack a mob outside of the reach of the wolf, then bring it closer, the wolf will not attack it even though the wolf can clearly reach it.

I was able to reproduce in 1.171 though on very rare occasions

Not fixed yet. Can reproduce in 1.19.3.

Can reproduce in 1.20.4 and it's because Mob.clearRestriction() is never called when the wolf is unleashed, resulting in its AI treating the entity as if it were still restricted to its last leashed position.

Lily

elvendorke

Confirmed

Mob behaviour

1.16.5, 1.17.1, 1.19 Pre-release 1, 1.19.3, 1.20.4

24w11a

Retrieved