mojira.dev
MC-311128

Fishing bobbers no longer expire one minute after being hooked into a block, even though the logic for this behavior still exists in the code

Background

FishingHook.tick() contains following logic:

if (this.onGround()) {
    this.life++;
    if (this.life >= 1200) {
      this.discard();
      return;
    }
} else {
    this.life = 0;
}

The hook is intended to be retrieved after being on ground for 60s (1200 ticks).
This no longer works like intended, starting from version 25w18a (1.21.6 snapshot) and until now (last tested 26.3-snapshot-8).
UPDATE: This is tested and still present in release 26.3.

Expected

Following behavior is expected after reading the code:

  1. Player uses fishing rod

  2. Bobber lands on the ground

  3. Bobber disappears after 60 seconds and fishing rod retrieves

This behavior is present in all versions up until 25w17a.

Actual

  1. Player uses fishing rod

  2. Bobber lands on the ground

  3. Bobber stays on the ground indefinitely

This behavior is present starting from 25w18a and up until now (26.3-snapshot-8).

Notes

This change of behavior is likely explained by this diff in FishingHook.tick():

-         if (!fluidState.is(FluidTags.WATER)) {
+         if (!fluidState.is(FluidTags.WATER) && !this.onGround() && this.hookedIn == null) {
             this.setDeltaMovement(this.getDeltaMovement().add(0.0, -0.03, 0.0));
         }

Due to this, the bobber keeps glitching out of the block and gets onGround=false, thus resetting this.life back to zero.

Steps

In the attachment you can see a recording of me performing following steps in each environment (new/actual first, old/expected second):

  1. Reset scoreboard

  2. Set tick rate to 2000

  3. Activate scoreboard addition

  4. Throw bobber

  5. Observe results:

    1. Expected: score stops just above 1200

    2. Actual: score does not stop

Additional steps:

  1. Set tick rate to 2

  2. Activate logging of NBT onGround state

  3. Throw bobber

  4. Observe results:

    1. Expected: bobber lands and remains with onGround=true

    2. Actual: bobber lands and fluctuates between onGround=true and onGround=false

Fix

-         if (!fluidState.is(FluidTags.WATER) && !this.onGround() && this.hookedIn == null) {
+         if (!fluidState.is(FluidTags.WATER) && this.hookedIn == null) {
             this.setDeltaMovement(this.getDeltaMovement().add(0.0, -0.03, 0.0));
         }

Removing the onGround? check before applying down force, makes the bobber stick in the ground correctly and expire after 1200 ticks.

Linked issues

Attachments

Comments 2

Thank you for helping us improve Minecraft! We saved your files:

[media]

Can confirm. This was caused by the fix for MC-280281. The NBT alternating itself was already WF’d in MC-300620, but perhaps Mojang would take a second look since there is a clear gameplay impact resulting from it.

D.P.

(Unassigned)

Confirmed

Platform HC

Normal

Entities, Networking

26.2, 26.3 Snapshot 8, 26.3

Retrieved