Fishing hook / bobber cannot kill itself after 1200 ticks and bounces on land
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; } //... } }
Created Issue:
Fishing hook / bobber cannot kill itself after 1200 ticks
Relates to
MC-87456The 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; } //... } }
Relates to
MC-87456The 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; } //... } }
relates to
relates to
relates to
relates to
If the durability it loses is 2 then it is very likely caused by MC-98922
The problem is that the xTile, yTile, zTile and inTile are not updated, however it tests if the the block at this position is the block stored as inTile if it is inGround. If this is not the case (which always happens) inGround is set to false because it assumes the hook moved. This durability reduction is because the hook is inGround.
Please do not put two issues into one ticket.
The part about the bobber is intended. What should it do instead? Before 16w43a, it bounced on the ground (MC-98922), which is fixed now.
For the crash log, go to your .minecraft folder and open the crash-logs folder. You can get to the .minecraft folder by going to the "Launch options" tab in your (new) launcher, select the launch option you used and click on the arrow symbol next to "Game directory".
Relates to MC-98922
The fix for that bug should have fixed that, but apparently it did not?
Looks like it is not fixed for 16w43a, see also
MC-109277