[BUG] "Dangerously Close To Gods" advancement does not adequately detect half a heart of health
SilvariusCoyote opened this issue · 2 comments
Describe the bug
The advancement for reaching half a heart of health while under the Divinity effect does not accurately identify half a heart of health. In the current alpha branch, the range of health at which the advancement appears to be granted is 0.1 to 0.99; in the release branch, this range is 0.1 to 0.9. These values may be incorrect, as half a heart of health is equal to 1 hp; I believe that hp is stored as a float, so I don't know what the actual range of hp is which equates to half a heart displayed on the HUD. In either case, it is not only possible, but very easy, to reach half a heart of health and not get the advancement. In fact, I haven't been able to get the advancement once, so I it's possible that the advancement is broken altogether.
To Reproduce
While the Divinity effect is active, fall from a height of 22 or 23 blocks. Both heights will take the player from full health to half a heart without any damage modifiers active (e.g. feather falling). I have tested this on both the current release (1.6.12) and develop (1.7.0-alpha19).
Expected behavior
The advancement should be given under the same conditions which result in the HUD displaying half a heart of health.
Mod version
1.6.12(release) and 1.7.0-alpha19(develop)
This might not even work if it's only meant to detect 19 points of damage from full HP; this is in the case of Mods that may increase max hp
Hexcasting has something in place that can detect a player going from Full all the way down to critical (1 HP remaining) for an advancement trigger, and it's made it to work to scale with player HP
It could also be possible that there is a rounding error as it may not trigger properly if the damage goes below 1HP yet is not equal to zero.
If this is the case, then my suggestion is to have whatever is detecting the player's HP and comparing it to the value of one would be instead taking the current HP and having the value be roofed; that way, if for whatever reason, the players, HP is below one, but not equal to zero; that value that's being looked at will automatically be rounded up to the whole number.