mojira.dev
MC-179945

An increased max health attribute causes ghost hearts to appear after death

The bug

After attributing yourself with a higher max health then dying the previous row added becomes ghost hearts not regenerating or giving extra hearts.

How to reproduce

  1. Make sure your health/hunger bars are full

  2. Run these commands in order while in survival mode:

    /attribute @s minecraft:generic.max_health base set 40
    /attribute @s minecraft:generic.max_health base get

    ✔ notice the result is 40, and the health bar has doubled and will slowly regenerate a bit

  1. Now run these commands:

    /kill @s
    /attribute @s minecraft:generic.max_health base get

    ❌ notice how it now says 20 and the hearts in the top row are now empty and refuse to regenerate

Linked issues

Attachments

Comments

Avoma

I am unable to reproduce this issue in 20w51a.

Avoma

Also unable to reproduce in 21w06a.

violine1101

Could you please provide steps to reproduce, as well as the exact commands used?

Jack McKalling

I was only able to reproduce the "ghost" hearts that don't regenerate, in this very 20w17a snapshot. In any newer version of the game, even 1.16.5 and 21w06a, these hearts don't show but your health is still reduced back to 20.

Jack McKalling

The problem with the attibute resetting after death, is already tracked by MC-179940.
The ghost hearts have indeed been fixed, probably along with or due to the fix for MC-179863.

Lazlo

(Unassigned)

Confirmed

Low

Commands

20w17a

20w18a

Retrieved