The bug
The drowned don't chase you even if you are right next to them in the water if the water is 1-block deep.
How to reproduce
Spawn a drowned into 1 block deep water (make sure the drowned is not a a baby)
Move around in the pool with the drowned (in survival mode)
→ ❌ The drowned will not chase the player
Code Analysis
@unknown - The following is based on 1.17 Release Candidate 1 yarn mappings.
The call to this.isTouchingWater()
in net.minecraft.entity.mob.DrownedEntity
as seen in the following code snippet makes the drowned attempt to use water pathfinding whenever touching water, which makes the drowned not able to pathfind as their water pathfinding is meant for swimming. Instead, this would be fixed by replacing that call with this.isSubmergedInWater()
, as that checks whenever the entity is completely underwater which allows swimming and uses land pathfinding in one block deep water.
net.minecraft.entity.mob.DrownedEntity
public void travel(Vec3d movementInput) {
if (this.canMoveVoluntarily() && this.isTouchingWater() && this.isTargetingUnderwater()) {
this.updateVelocity(0.01F, movementInput);
this.move(MovementType.SELF, this.getVelocity());
this.setVelocity(this.getVelocity().multiply(0.9D));
} else {
super.travel(movementInput);
}
}
Linked issues
is duplicated by 2
Attachments
Comments 29
Affects 1.13-pre6. Please keep your issue updated.
The drowned will use their "swimming" animation, but not actually go anywhere. If you get too close, they hurt you.
If the drowned is a baby (boolean tag IsBaby
set to 1), it chases the player as expected. Drowned that aren't babies, however, are affected.
Still in 18w20c