The bug
Mining lots of blocks at once by holding your mouse while equipped with a tool capable of instamining blocks (efficiency 5 diamond shovel vs dirt, for example) will leave some blocks on the server, but the client thinks they're gone.
This bug can occur on a server running 20 TPS constantly. It only occurs when the time to break a block is instant, e.g. with a diamond pickaxe on Nether rack or high-Efficiency diamond shovel on dirt. While the block in question disappears from the client's view (it is not rendered anymore and is removed from clientside collision), the server says it's still there and pushes the players' movement back when the client tries to move within the block's space. This can be a quite tricky and dangerous situation, especially when taking down a pillar below you: You fall into the ghost block again and again (many times a second) and cannot move. Client and server arrive at no consensus over whether the block is still there or not. Reloading the chunks on the client by pressing F3+A does not resolve this. It can be resolved by trying to place a new block in the old location. This of course fails server-side, the new block is not placed, but the old one reappears client-side. It can also be resolved by rejoining the server.
How to reproduce (with provided structure)
Partwise by @unknown
Download the attached structure
and place it in the
structures
folder of your world folderStand on the command block, and switch your gamemode to Survival
/gamemode survival
Press the button
Hold down the block breaking key (default: left click) and move forward without rotating
→ The red sandstone block became a ghost-block
How to reproduce
See
[media]for the video version
Build a two block wide sandstone tower
Give yourself an efficiency pickaxe
/give @p diamond_pickaxe 1 0 {ench:[{id:32s,lvl:5s}]}
Move to the top of the tower and stand in the middle of the two blocks
Switch to Survival mode
/gamemode survival
Look at one block
Hold down the block breaking key (default: left click) and move towards the block you are looking at
→ While falling you get stuck in a ghost block
Code analysis
Based on 1.12 decompiled using MCP 9.40 PRE 1
It looks like this bug is caused by the server thinking that the player is not on ground and therefore cannot instamine a block while the client thinks it can. This can be seen when setting a breakpoint in net.minecraft.server.management.PlayerInteractionManager.onBlockClicked(BlockPos, EnumFacing)
for the specific block position where a ghost block will be (see "How to reproduce (with provided structure)") and then following the method calls to EntityPlayer.getDigSpeed(IBlockState)
.
For lagging servers or clients this another cause could likely be the method net.minecraft.network.NetHandlerPlayServer.processPlayerDigging(CPacketPlayerDigging)
which is not sending a SPacketBlockChange
packet to resync the block if the block position is too far away from the player.
Suggested fix by @unknown can be found in
[media]; explanation can be found in this comment
Linked issues
is duplicated by 43
relates to 2
Attachments
Comments 66
Not a duplicate of MC-858.
I can confirm this bug on vanilla 1.8.x servers. This happens often to me when mining blocks with instant-speed in Survival. It's a server-client synchronization issue and has little to nothing to do with lag.
To make the distinction clear: MC-858 describes the internal server having low TPS and therefore registering the block-breaking action from the client very late. This leads to the client re-displaying the block again, until it gets the confirmation from the server that its actually broken, seconds later, or not at all. At the end, the block is either broken or still there, on both client and server.
This bug (MC-5694) is different in that it can occur on a server running 20 TPS constantly. It only occurs when the time to break a block is instant, e.g. with a diamond pickaxe on Nether rack or high-Efficiency diamond shovel on dirt. While the block in question disappears from the client's view (it is not rendered anymore and is removed from clientside collision), the server says it's still there and pushes the players' movement back when the client tries to move within the block's space. This can be a quite tricky and dangerous situation, especially when taking down a pillar below you: You fall into the ghost block again and again (many times a second) and cannot move. Client and server arrive at no consensus over whether the block is still there or not. Reloading the chunks on the client by pressing F3+A does not resolve this. It can be resolved by trying to place a new block in the old location. This of course fails server-side, the new block is not placed, but the old one reappears client-side. It can also be resolved by rejoining the server.
So this is a persistent client-server asynchronicity and must be fixed independently from the (in my opinion) non-bug MC-858.
By the way, MC-7409 is a duplicate of this.
@unknown: Thanks, I split them up and made you the reporter of both tickets since the original reporters are both inactive.
As the other commenters said above me, this bug is back in the game.
Should I make another ticket for it?
Please see MC-156852 if you have this issue in 1.14.4.
Both this issue and a clone of it (MC-156852) have been resolved as fixed, in 17w50a and 19w34a respectively. If you're still experiencing it, create a new issue, with updated steps to reproduce, please.
Duplicate of MC-858.