mojira.dev
MC-312495

Player fall distance is off by one

When calculating fall damage, player fall distance seems to be off by one.

To reproduce:

  • Default attributes, safe_fall_distance = 3.0, fall_damage_multiplier = 1.0

  • Run /tp ~ ~3.0 ~, no damage as expected

  • Run /tp ~ ~3.5 ~, still no damage when it should be 1HP

  • Run /tp ~ ~3.9 ~, still no damage

  • Run /tp ~ ~4.0 ~, 1HP of damage when it should be 2

The same can be seen if e.g. safe_fall_distance is set to 2.0, you only start taking damage after you fall 3 blocks.

Was not an issue before 1.21.5.

Comments 1

Code analysis for the 26.3 client:

It appears that in 1.21.5 the formula in LivingEntity#calculateFallDamage was changed to round the final value down instead of up. Perhaps it was intentional, but as it stands the safe_fall_distance attribute is somewhat misleading.

RoccoDev

(Unassigned)

Unconfirmed

26.3

Retrieved