mojira.dev
MC-129298

Drowned don't chase you if they are in 1 block deep water

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

  1. Spawn a drowned into 1 block deep water (make sure the drowned is not a a baby)

  2. 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

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.

Confirmed for 1.13.2-pre2.

It also happened at night

19 more comments

can confirm in 1.17.1

Still an issue in 1.19 Release Candidate 1.

Still an issue in 1.19 Release Candidate 2.

Confirm in 1.19.4 Pre-release 3

Jon1337

coschevi

Confirmed

Platform

Important

Mob behaviour

ai, attack, attacking, chase, chasing, day, daytime, deep, drowned, hostility, mob, mob-behavior, mob_Al, mobs, pathfinding, time_of_day, water

Minecraft 18w19a, Minecraft 18w19b, Minecraft 18w20b, Minecraft 18w20c, Minecraft 18w21b, ..., 23w43b, 1.20.4, 24w04a, 1.21, 24w33a

24w35a

Retrieved