mojira.dev
MC-29274

Withers will not pursue players in survival mode unless attacked

The bug

Withers will not fly above a player and use its middle head to attack unless a player hits it first in survival mode. The other two heads, however, will fire at the player.

When the wither was introduced in version 1.4.2, it was hostile towards players without any intervention.

To reproduce

  1. Spawn a Wither.

  2. Notice the two small heads are firing at you, but the Wither itself is not flying above you or using its main head.

  3. Punch the Wither and notice it is now attacking as it normally would.

Linked issues

Attachments

Comments 11

Yes this is true in 1.7.4 too

This glitch has evolved (new AI?) in the latest snapshots. All of the wither's heads will not shoot unless attacked in 14w11b. In 1.7, the exact symptoms in the description will happen.

Suddenly it's as if Mojang pushed out a little hidden update to fix part of this bug. Wither's heads will shoot at players before provoked, but it still does not fly.

Confirmed for 15w45a.

1 more comments

Maybe the wither is currently searching for other entities? Kinda how it likes to attack literally EVERYTHING before it starts chasing the player. Just my opinion.   It could also be targeting one of its own heads to chase.

Confirmed/Reproduced in 20w28a.

I've been in the code for a while and it's actually really easy to fix this. It turns out someone Mojang forgot to add the PathfinderGoal to the Wither's Goal system to make it target players, as seen here:

this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityInsentient.class, 0, false, false, EntityWither.predicateTargetNotUndead));

 

EntityInsentient is the base class for all non Player entities, but the player classes EntityHuman and EntityPlayer do not extend EntityInsentient, so the Wither doesn't attack Players unless angered by them

 

This is easily fixed by adding this line of code after that line:

this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 0, false, false, EntityWither.predicateTargetNotUndead));

chumbanotz

Ulraf

Confirmed

Normal

Mob behaviour

attack, neutral, wither, wither_skull

Minecraft 1.6.2, Minecraft 1.7.4, Minecraft 14w05b, Minecraft 14w06b, Minecraft 14w07a, ..., 1.17, 1.17.1 Pre-release 1, 1.17.1 Pre-release 2, 1.17.1 Release Candidate 1, 1.17.1

21w37a

Retrieved