Attribute modifiers applied through the /attribute command are not preserved after the player dies. When a modifier is added to an attribute such as minecraft:max_health, it works correctly while the player is alive, but is completely removed upon death. After respawning, the attribute returns to its default value, as if the modifier had never been applied.
This behavior affects attribute modifiers added with commands like:attribute @p minecraft:max_health modifier add <id> 20 add_value
Steps to Reproduce
Run:
attribute @p minecraft:max_health modifier add <id> 20 add_valueDie (for example, using
/kill @p)Respawn
Run:
attribute @p minecraft:max_health modifier get <id>
Attachments
Comments 3
MC-179940 covers the player’s base attributes, which are preserved upon death; that fix does not however extend to attribute modifiers.
MC-179940 states this as fixed in Snapshot 24w20a. Is this a potential regression?