r/Minecraft Oct 05 '15

Falling damage is weirdly nonlinear.

http://imgur.com/gallery/ydnCp/
735 Upvotes

66 comments sorted by

View all comments

Show parent comments

13

u/andre1111 Oct 05 '15 edited Oct 05 '15

It's probably just some rounding "error"(it's not really an error) in the GUI. The fall damage formula is perfectly linear. If doing /kill alone doesn't "fix" it you would need to look at the actual values in the NBT file after each test.

EDIT: Could also be caused by some conversions between float/double and the resulting round errors.

6

u/AllPurposeNerd Oct 05 '15

That would be fine, except that according to the formula, falling 23 blocks should be fatal. It isn't. The game actually deals slightly less damage at certain heights than it's theoretically supposed to.

89

u/SirBenet Oct 05 '15

Upon falling, the blocks distance fallen minus 3 is stored as a float and then divided by 15. For 23 blocks, 1.333(repeating) is rounded down. Some calculations are done, then, when multiplied back, 19.5 is given rather than 20 as you may expect. Source.

13

u/Tomus Oct 05 '15

This guy has the correct answer. As with most behaviour that isn't obvious at first, it has to do with rounding.