mojira.dev
MC-8471

Blocks cannot be placed on a block you are next to

The bug

Sometimes blocks cannot be placed on a block you directly standing next to. When you place them they appear for a short moment (client-side) but directly afterwards disappear.

How to reproduce

  1. Dig a 1 block deep hole

  2. Move up against any side or corner of the hole

  3. Attempt to place a repeater or comparator on the block you moved towards
    → The repeater will appear and disappear immediately, as if the server thinks you are occupying the space and cannot place a block.

If you cannot reproduce the bug, try sprinting against the block.

Cause

The cause seems to be that the server thinks the player is intersecting with the collision box of the block to be placed while the client thinks he is not.

For example

To check: box[13.0, 4.0, 8.0 -> 14.0, 4.875, 9.0]

Client player: box[14.0, 4.0, 8.080747030085668 -> 14.600000023841854, 5.799999952316284, 8.680747053927526]
Server player: box[13.999999999999998, 4.0, 8.085848427457286 -> 14.600000023841856, 5.799999952316284, 8.685848451299144]

However, it is interesting that the server let the client move inside the block in the first place.

Code analysis

Based on 1.11.2 decompiled using MCP 9.35 rc1

Removed part
The reason why the method net.minecraft.network.NetHandlerPlayServer.processPlayer(CPacketPlayer) did not prevent the movement then is because it contracts the player bounding box by 0.0625. Removing this might solve the problem as well, but could result in the player being teleported back when running with the speed effect against a wall or similar.

Edit: Code analysis was partwise wrong. The actual reason is not quite clear.

Linked issues

Comments 46

Unable to reproduce. Please provide screenshots.

Now I can't reproduce it either, having restarted. Sorry for the noise!

DicoTheRedstoner

I've also experienced this issue, actually
( a lot )

I agree that the behavior in the above video is similar to what I experienced when I made this report.

36 more comments

Confirm 1.10.2

Confirm for 1.11

Since I always had problems trying to reproduce this bug, can someone please check if this is still an issue in the latest development snapshot?

I also can't reproduce in the latest 1.13 snapshot using Jesper's video instructions

Josiah Abram Guthrie

I have a similar problem. I am unable to place blocks in a 4x4 block area. 

Kevin Reid

(Unassigned)

Confirmed

placement, redstone, redstone-comparator, redstone-repeater

Snapshot 13w04a, Minecraft 1.7.4, Minecraft 14w08a, Minecraft 1.7.5, Minecraft 14w32d, ..., Minecraft 16w20a, Minecraft 1.10.2, Minecraft 16w42a, Minecraft 1.11, Minecraft 17w06a

Snapshot 13w10b, Minecraft 18w05a

Retrieved