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.0Run
/tp ~ ~3.0 ~, no damage as expectedRun
/tp ~ ~3.5 ~, still no damage when it should be 1HPRun
/tp ~ ~3.9 ~, still no damageRun
/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.
Code analysis for the 26.3 client:
It appears that in 1.21.5 the formula in
LivingEntity#calculateFallDamagewas changed to round the final value down instead of up. Perhaps it was intentional, but as it stands thesafe_fall_distanceattribute is somewhat misleading.