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
Spawn a Wither.
Notice the two small heads are firing at you, but the Wither itself is not flying above you or using its main head.
Punch the Wither and notice it is now attacking as it normally would.
Linked issues
is duplicated by 4
Attachments
Comments 11
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.
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.
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));
Yes this is true in 1.7.4 too