mojira.dev
MC-267927

The hitboxes of magma cubes are too large

In 24w03a the hitboxes of the magma cubes have been increased to be way too big.

Linked issues

Attachments

Comments 3

I can also confirm this issue.

Code analysis (Yarn mappings)

The SlimeEntity#getBaseDimensions method was updated in Minecraft snapshot 24w03a to not scale the entity's dimensions by 0.255 dynamically. Instead, the slime entity type's static dimensions were adjusted to get an equivalent result; the 2.04 width and 2.04 height dimensions scaled by 0.255 are now simply 0.52 width and 0.52 height. Magma cubes inherit the dynamic scaling by inheriting the SlimeEntity#getBaseDimensions method, but the magma cube entity type does not inherit dimensions from the slime entity type. The end result is that magma cubes still have the original 2.04 width and 2.04 height dimensions, but these dimensions are not scaled dynamically to create the correct dimensions as was the case previously.

The solution is simply to change the dimensions of the magma cube entity type:

public static final EntityType<MagmaCubeEntity> MAGMA_CUBE = register("magma_cube", EntityType.Builder.<MagmaCubeEntity>create(MagmaCubeEntity::new, SpawnGroup.MONSTER)
    .makeFireImmune()
    .setDimensions(2.04F, 2.04F)
    .method_55687(1.275F)
    .dimensions(2.04F, 2.04F) // incorrect values, should be 0.52F, 0.52F to match slime entity type
    .eyeHeight(1.275F)
    .maxTrackingRange(8)
);

Note that the scaling change results in slightly different dimensions being computed in the end. The original dimensions were computed as 2.04 * 0.255, resulting in 0.5202, while the new dimensions are 0.52, meaning slimes are now 0.0002 smaller on all axes. This is possibly a parity difference with Bedrock Edition.

I suggest making a separate report for the 0.0002 size change of slimes. It effectively also means that if you set a large scale for slimes, the hitbox no longer lines up with the model in size.

Austin Deville

gegy

Confirmed

Platform

Very Important

Hitboxes

24w03a

24w03b

Retrieved