Minecraft
  1. Minecraft
  2. MC-98922

Fishing hook / bobber cannot kill itself after 1200 ticks and bounces on land

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 1.9, Minecraft 16w15b, Minecraft 16w43a
    • Fix Version/s: Minecraft 16w44a
    • Security Level: Minecraft - Public (Viewable by everyone)
    • Confirmation Status:
      Unconfirmed

      Description

      The bug

      The following is based on decompiled version of Minecraft 1.8 using MCP. All method and class names are the names used in the decompiled version.

      The public void onUpdate() method of the net.minecraft.entity.projectile.EntityFishHook class is supposed to kill the fishing hook after being for 1200 ticks inside a block. The problem is that the value for the inTile field is never set. This is also the reason why the hook is bouncing on land.

      /**
       * Called to update the entity's position/logic.
       */
      public void onUpdate()
      {
          super.onUpdate();
      
          if (this.fishPosRotationIncrements > 0)
          {
              //...
          }
          else
          {
              //...
      
              if (this.inGround)
              {
                  // The problem is that inTile is never set
                  if (this.worldObj.getBlockState(new BlockPos(this.xTile, this.yTile, this.zTile)).getBlock() == this.inTile)
                  {
                      ++this.ticksInGround;
      
                      if (this.ticksInGround == 1200)
                      {
                          this.setDead();
                      }
      
                      return;
                  }
      
                  this.inGround = false;
                  this.motionX *= (double)(this.rand.nextFloat() * 0.2F);
                  this.motionY *= (double)(this.rand.nextFloat() * 0.2F);
                  this.motionZ *= (double)(this.rand.nextFloat() * 0.2F);
                  this.ticksInGround = 0;
                  this.ticksInAir = 0;
              }
              else
              {
                  ++this.ticksInAir;
              }
              
              //...
          }
      }
      

        Issue Links

          Activity

          Hide
          [Helper] Marcono1234 added a comment -

          Looks like it is not fixed for 16w43a, see also MC-109277

          Show
          [Helper] Marcono1234 added a comment - Looks like it is not fixed for 16w43a, see also MC-109277

            People

            • Assignee:
              [Mojang] Maria Lemón
              Reporter:
              [Helper] Marcono1234
            • Votes:
              5 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: