PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
9.96k stars 2.31k forks source link

AttributeModfiers is not removed when the player dies #10684

Closed huimanman closed 5 months ago

huimanman commented 5 months ago

Expected behavior

All modifiers added by /attribute are removed upon death

Observed/Actual behavior

The modifiers added by /attribute to still exist after rebirth

Steps/models to reproduce

  1. run /attribute @s minecraft:generic.armor modifier add 1-0-0-0-0 "" 1 add_value
  2. run /attribute @s minecraft:generic.armor modifier value get 1-0-0-0-0
  3. run /kill @s
  4. Respawn
  5. Run again /attribute @s minecraft:generic.armor modifier value get 1-0-0-0-0

Plugin and Datapack List

plugins [10:43:44 INFO]: Server Plugins (0):

datapack list [10:44:13 INFO]: There are 3 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)], [paper (built-in)] [10:44:13 INFO]: There are no more data packs available

Paper version

version [10:44:27 INFO]: Checking version, please wait... [10:44:28 INFO]: This server is running Paper version git-Paper-55 (MC: 1.20.6) (Implementing API version 1.20.6-R0.1-SNAPSHOT) (Git: 1b67e02) You are running the latest version

Other

No response

Malfrador commented 5 months ago

Attributes being reset on death is considered a bug by Mojang: https://bugs.mojang.com/browse/MC-179940

Paper generally aims to fix bugs, especially if they are confirmed by Mojang but unfixed. I'm inclined to say this is working as intended for that reason, but maybe there are other opinions on this.

If this is fixed at all, it would need to be only fixed for modifiers applied by the command which seems complicated. Changing this behaviour for the API too would be a major API break, and needlessly annoying for plugins who then need to listen to an additional event to reapply modifiers.

Edit: Mojang has fixed MC-179940, presumably for 1.21.

Machine-Maker commented 5 months ago

This is officially "works as intended" as Mojang have fixed the linked issue. Attributes are expected to be retained on player deaths.