The Bug
When your max health is set to 0, you don't die directly. This is caused by MC-16345.
Additionally, when you take damage, you die twice. This is MC-19690.
How to Reproduce
/attribute @s minecraft:generic.max_health base set 0
→ ❌ You are still alive, with one heartTake damage and die
Click respawn
→ ❌ You are resurrected at the same location as you died, now with half a heart (MC-19690)Die again
→ ✔ You now respawn properly
Observed Behavior
Players remain alive when their "minecraft:generic.max_health" attribute is set to "0".
Expected Behavior
Players would die and not remain alive when their "minecraft:generic.max_health" attribute is set to "0".
Linked issues
Attachments
Comments 9


I wonder if this relates to a different bug where modifying the generic.max_health attribute in a certain way really fast and giving the player instant damage could cause the player to "die", get a fake respawn screen, and get stuck in the death animation. This is MC-19690 I am mentioning if that helps.
Duplicate of MC-19690.
Not quite. It's very closely related, but I believe the core issue here is that the player doesn't die as soon as max health is set to 0.
Can confirm in 1.17.1.
Can confirm this behavior in 21w42a. Here are some extra details regarding this problem.
The Bug:
Players remain alive when their "minecraft:generic.max_health" attribute is set to "0".
Steps to Reproduce:
Switch into survival mode and set your "minecraft:generic.max_health" attribute to "0".
/attribute @s minecraft:generic.max_health base set 0
Take note as to whether or not you are still alive after executing this command.
Observed Behavior:
Players remain alive when their "minecraft:generic.max_health" attribute is set to "0".
Expected Behavior:
Players would die and not remain alive when their "minecraft:generic.max_health" attribute is set to "0".
Can confirm in 1.18.2 and 22w15a.
Can confirm in 1.19 and 1.19.1 Pre-release 1.
Can confirm in 1.19.2.
i dont think you are suposed to set that to 0, cuz what you are doing is making it so you constaly die, because you have no health