-
Bug
-
Resolution: Invalid
-
None
-
20w17a
-
None
-
windows 10 x64, Java version 8 update 251 (build 1.8.0_251-b08),
-
Unconfirmed
-
(Unassigned)
Before starting the bug report, I would like to define a few things:
1.)current health - the amount of health a player has, independent of max health
2.)max health - as the attribute minecraft:generic.max_health
3.)displayed health - the number of heart containers shown
4.)health update - any event that causes a player's health to change, such as healing or damage.
5.)the command - /attribute
Whenever a player's max health is set to below their current health, current health does not change until a health update is received even though displayed health is changed. When the health update occurs, several things happen. If the health update was damage, then the damage is taken at the old current health. Then, if the current health is still greater than the max health, current health is set to max health. If the health update was healing, current health is set to the new max health. Then, if the difference between the old current health and the new current health is greater than or equal to the new max health, the "You Died" screen is shown. From here, clicking respawn will not do anything and the game will resume as normal, without killing or respawning the player, and everything will work as expected.
Whenever a player who has had their max health set to anything other than the default (20) dies and respawns, their max health is reset to 20, or seems to function as though it has been reset. The displayed health will still remain as though it has been changed through the command. The current health will not go higher than 20, healing and damage function normally and will not change the displayed health.