mojira.dev
MC-253479

Magma Cubes can still jump on honey blocks

The bug

Magma Cubes, especially the larger ones, can still jump up blocks whilst standing on honey blocks.

To reproduce

  1. /fill ~20 ~ ~20 ~ ~ ~ minecraft:honey_block

  2. Summon magma cubes on top of the blocks.

Observed result

The magma cubes are able to jump.

Code analysis

Code analysis can be found in this comment.

Linked issues

Attachments

Comments

MMK21

Clones MC-163019

anthony cicinelli

I was unable to reproduce. The Magma Cubes jump was restricted by the honey block

violine1101

Could you please provide a screenshot of your setup? Maybe some of the magma blocks are not fully on top of the honey blocks but partially stand on top of other blocks and then are able to jump.

ampolive

I was able to reproduce for large magma cubes.

Avoma

Can confirm in 1.19.1.

Avoma

Can confirm in 1.19.2.

ampolive

Code analysis (Mojang mappings, 1.19.2): Normally a living entity's jump is restricted by honey blocks in jumpFromGround(), but for magma cubes that is only partially the case. In MagmaCube#jumpFromGround():

Vec3 $$0 = this.getDeltaMovement();
        this.setDeltaMovement($$0.x, this.getJumpPower() + (float)this.getSize() * 0.1f, $$0.z);
        this.hasImpulse = true;

In LivingEntity#getJumpPower, the block jump factor is taken into account. For magma cubes, there is an additional (float)this.getSize() * 0.1f that gets added which is not scaled by its jump factor. A potential fix:

Vec3 $$0 = this.getDeltaMovement();
        this.setDeltaMovement($$0.x, this.getJumpPower() + (float)this.getSize() * 0.1f * this.getBlockJumpFactor(), $$0.z);
        this.hasImpulse = true;

This fix isn't perfect – magma cubes with a Size of about 8 or above can still jump high enough to escape the honey blocks, but this still significantly restricts the jump in honey blocks.

tomozbot

(Unassigned)

Confirmed

Gameplay

Normal

Mob behaviour

1.19, 1.19.1 Pre-release 1, 1.19.1 Pre-release 5, 1.19.2, 22w45a, ..., 25w05a, 25w09b, 1.21.5 Release Candidate 1, 1.21.5, 25w17a

Retrieved