[MC-1594] Trying to walk from a block with a collision box shorter than 1 block to another block that is also shorter, causes you to momentarily glitch into the ground Created: 01/Nov/12  Updated: 06/May/15  Resolved: 15/Mar/13

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.2, Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w01a, Snapshot 13w01b
Fix Version/s: Minecraft 1.5

Type: Bug
Reporter: Jordan Doorlag Assignee: Unassigned
Resolution: Fixed Votes: 6
Labels: bed, collisions, hitbox, slabs, walking
Environment:

All


Issue Links:
Duplicate
is duplicated by MC-5329 Jerky camera movement when walking fr... Resolved
is duplicated by MC-6024 Moving wrong when walking from daylig... Resolved
is duplicated by MC-6129 Walking from a daylight sensor to any... Resolved
is duplicated by MC-442 Player sinks into the ground slightly... Resolved
is duplicated by MC-2066 Anvil Glitch. Going from Slab to Anvi... Resolved
is duplicated by MC-2460 Bouncing up and down by bed Resolved
is duplicated by MC-2737 Bed surrounded by half slabs Resolved
is duplicated by MC-4805 Entity bounce when traversing blocks ... Resolved
CHK:
Confirmation Status: Community Consensus

 Description   

If you walk from a block that is shorter than a full block to another block that is also shorter than a full block, but taller than the first, you will momentarily glitch into the original into the block you are walking onto.
Reproducing:
1 Place a bed on the ground
2 Place an enchantment table directly next to the bed
3 Attempt to walk from the bed onto the enchantment table.
4 You will glitch down into the enchantment table, then pop back up.
~ Works with any two blocks as long as neither block is a full block, and you are going onto a block with a taller collision box



 Comments   
Comment by UncleMion [ 07/Jan/13 ]

I can confirm this bug. I had to fix it for my resizing mod to work properly, after it kept causing "illegal stance" errors in multiplayer.

(Using MCP v7.25 on Minecraft 1.4.6)

The piece of code that needs to be changed is in the Entity.moveEntity method, in the part right before the Profiler section "rest", just before where Entity.ySize gets changed:

double var40 = this.boundingBox.minY - (double)((int)this.boundingBox.minY);

The "(double)(int)" causes the player to glitch through to the bottom of the short block before getting popped back up. My fix was this:

double var40 = this.boundingBox.minY - var29.minY;

Where "var29" was the copy of the entity's bounding box made before checking block collisions:

AxisAlignedBB var29 = this.boundingBox.copy();

I hope this helps

Generated at Sun Jan 12 11:54:58 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.