mojira.dev
MC-99583

Lily pad collision box is larger than what the model would imply

The bug

Just when you're on a lily pad you see like if you aren't on the lily pad, you're floating. This could be fixed by either decreasing the size of the lily pad hitbox, or, preferably, thickening the lily pad's model.

How to reproduce

  1. Place a lily pad

  2. Stand on it

Code analysis

Code analysis by @unknown can be found in this comment.

Attachments

Comments 24

Can confirm for MC 1.12.1.

The following is based on a decompiled version of MC 1.12.1 using MCP 9.40pre-1.

The field net.minecraft.block.BlockLilyPad.LILY_PAD_AABB detemines how big the collision box of a lily pad is. Currently, a lily pad's collision box is 0.09375 full blocks high which makes the player seem to float above the lily pad as the lily pad itself doesn't really have a height. Therefore, a simple fix would be to just make the collision box a bit lower (smaller in the y-direction), woah!

// Original values (AxisAlignedBB(x1, y1, z1, x2, y2, z2)
protected static final AxisAlignedBB LILY_PAD_AABB = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.09375D, 0.9375D);
// Modified values (y2 - 0.08)
protected static final AxisAlignedBB LILY_PAD_AABB = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.01375D, 0.9375D);

Even though this does fix the problem, I actually think this "bug" might be intentional. The thing is that when the character is sneaking, its model is lowered down. Since the texture of a lily pad doesn't really have a height, the character glitches through the lily pad a bit when sneaking on it. This glitching becomes even more intense when the collision box of the lily pad is smaller. (default collision box | adjusted collision box)

Anyway, this is how standing on a lily pad looks like with a lower collision box.

14 more comments

Can confirm in 1.18.1.

Can confirm in 1.18.2 and 22w15a.

[media]

Can confirm in 1.19.

Can confirm in 1.19.2.

In snapshot 15w45a, the collision box of the lily pad was enlarged to facilitate mob pathfinding over them.

Pol Abadia Conejos

muzikbike

(Unassigned)

Confirmed

Gameplay

Low

Hitboxes

incorrect-block-hitbox, lily_pad

Minecraft 1.9, Minecraft 1.10.2, Minecraft 16w41a, Minecraft 16w42a, Minecraft 16w43a, ..., 1.20.3 Release Candidate 1, 1.20.4, 1.21.4, 25w02a, 1.21.5

Retrieved