Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-129298

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 24w35a
    • Minecraft 18w19a, Minecraft 18w19b, Minecraft 18w20b, Minecraft 18w20c, Minecraft 18w21b, Minecraft 18w22c, Minecraft 1.13-pre6, Minecraft 1.13-pre8, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a, Minecraft 18w32a, Minecraft 1.13.1-pre1, Minecraft 1.13.1, Minecraft 1.13.2-pre2, Minecraft 1.13.2, Minecraft 18w43b, Minecraft 18w43c, Minecraft 18w44a, Minecraft 18w45a, Minecraft 18w47b, Minecraft 18w50a, Minecraft 19w02a, Minecraft 19w03a, Minecraft 19w03b, Minecraft 19w03c, Minecraft 19w07a, Minecraft 19w08a, Minecraft 19w08b, Minecraft 19w09a, Minecraft 19w11a, Minecraft 19w11b, Minecraft 19w12b, Minecraft 19w13a, Minecraft 1.14 Pre-Release 3, Minecraft 1.14 Pre-Release 4, Minecraft 1.14 Pre-Release 5, 1.14.4, 19w34a, 19w35a, 19w36a, 19w37a, 19w38b, 19w39a, 19w40a, 19w41a, 19w42a, 19w44a, 19w45b, 1.15 Pre-release 1, 1.15 Pre-Release 2, 1.15.1, 1.15.2 Pre-release 2, 1.15.2, 20w06a, 20w07a, 20w09a, 20w10a, 20w11a, 20w12a, 20w13b, 20w14a, 20w15a, 20w16a, 20w17a, 20w18a, 20w21a, 20w22a, 1.16 Pre-release 2, 1.16 Pre-release 5, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w27a, 20w28a, 20w29a, 1.16.2, 1.16.3, 1.16.4 Release Candidate 1, 1.16.4, 20w48a, 21w03a, 21w05b, 1.17 Release Candidate 2, 1.17, 1.17.1, 21w37a, 1.18.2, 22w14a, 22w15a, 1.19 Release Candidate 1, 1.19 Release Candidate 2, 1.19, 1.19.3, 23w05a, 23w07a, 1.19.4 Pre-release 3, 1.20, 1.20.1, 23w31a, 23w32a, 23w33a, 23w35a, 1.20.2 Pre-release 1, 1.20.2 Pre-release 2, 1.20.2 Pre-Release 3, 1.20.2 Pre-Release 4, 1.20.2 Release Candidate 1, 1.20.2 Release Candidate 2, 1.20.2, 23w40a, 23w43b, 1.20.4, 24w04a, 1.21, 24w33a
    • Confirmed
    • Mob behaviour
    • Important
    • Platform

      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

      TriWonder81 - 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);
              }
      
          }
      

            cojomax99 [Mojang] Cory Scheviak
            jouppi22 Jon1337
            Votes:
            37 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: