mojira.dev
MC-279731

Persistent/permanent attribute modifiers do not persist upon respawning

Attribute modifiers (added via the /attribute command) do not persist on players upon respawning (joining/leaving a world works fine.)

I'm reporting this as the name of the method used in the /attribute command for adding attribute modifiers (EntityAttributeInstance#addPersistentModifier in Yarn, EntityAttributeInstance#addPermanentModifier in Mojmap) implies that the attribute modifiers will persist/permanent (which is only partially true.)

This can be reproduced by doing the following:

  1. Execute /attribute @s minecraft:max_health modifier add testing 20 add_value to add a modifier to the 'minecraft:max_health' attribute (the attribute doesn't actually matter.)

  2. Execute /data get entity @s attributes[{id: "minecraft:max_health"}].modifiers to display modifiers for the 'minecraft:max_health' attribute (there should be a single element in the list.)

  3. Die and do step 2. The attribute will no longer have the modifiers that was present previously.

Comments 2

Death resets the player back to base stats. If you want the change to stay, modify the base instead.

The names of features in the code is not an indicator for what is intended behavior.

eggohito

(Unassigned)

Unconfirmed

(Unassigned)

1.21.4

Retrieved