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

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

XMLWordPrintable

    • Unconfirmed

      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;
              }
              
              //...
          }
      }
      

            Excited Maria Lemón
            marcono1234 Marcono1234
            Votes:
            5 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: