The bug
Some aquatic mobs on the honey block can jump because of the stranding.
Affected mobs
Cod
Salmon
Pufferfish
Tropical fish
Dolphin
Guardian
Elder guardian
Tadpole
Code analysis
Code analysis by @unknown can be found in this comment.
Related issues
is duplicated by
relates to
Attachments
Comments

Can confirm in 20w51a.
Can confirm in 21w05b.
Can confirm in 21w07a.
Video attached.
Can confirm in 1.18.1.
Can confirm in 1.18.2.
Code analysis / Fix (MCP 1.20.1):
After the game checks if any one of these entities is not in water, it applies modification to their DeltaMovement to make them jump. The issue comes from the fact that the 'y' value is only set as a simple double or float, and never modified depending on what block the entity is above (in this case, honey).
One possible solution for this (probably would need tuning), is to multiply the y delta movement by the "getBlockJumpFactor()" gotten from block below the entity. (This is what is done for slimes and magma cubes as well)
Guardian.class
net.minecraft.world.entity.monster/Guardian.java / aiStep()
else if (this.onGround()) {
this.setDeltaMovement(
this.getDeltaMovement().add(
((this.random.nextFloat() * 2.0F - 1.0F) * 0.4F),
FIX ---> 0.5D * this.getBlockJumpFactor(),
((this.random.nextFloat() * 2.0F - 1.0F) * 0.4F)
));
this.setYRot(this.random.nextFloat() * 360.0F);
this.setOnGround(false);
this.hasImpulse = true;
}
AbstractFish.class
net.minecraft.world.entity.animal/AbstractFish.java aiStep()
public void aiStep() {
if (!this.isInWater() && this.onGround() && this.verticalCollision) {
this.setDeltaMovement(this.getDeltaMovement().add(
((this.random.nextFloat() * 2.0F - 1.0F) * 0.05F),
FIX ---> 0.4F * this.getBlockJumpFactor(),
((this.random.nextFloat() * 2.0F - 1.0F) * 0.05F)));
this.setOnGround(false);
this.hasImpulse = true;
this.playSound(this.getFlopSound(), this.getSoundVolume(), this.getVoicePitch());
}
super.aiStep();
}
Dolphin
net.minecraft.world.entity.animal/Dolphin.java / tick()
if (this.onGround()) {
this.setDeltaMovement(this.getDeltaMovement().add(
((this.random.nextFloat() * 2.0F - 1.0F) * 0.2F),
FIX ---> 0.5D * this.getBlockJumpFactor(),
((this.random.nextFloat() * 2.0F - 1.0F) * 0.2F))
);
this.setYRot(this.random.nextFloat() * 360.0F);
this.setOnGround(false);
this.hasImpulse = true;
}
This is the behavior the fix achieves:
[media]