-
Bug
-
Resolution: Unresolved
-
None
-
1.15.2, 20w18a, 1.16.2, 20w51a, 21w03a, 1.16.5, 21w08b, 21w20a, 22w18a, 24w20a
-
None
-
Confirmed
-
Entities
The bug
Although MC-135247 no longer applies for normal phantoms since 19w08a, phantoms with size greater than 1 still have the attack damage attribute reset when the world is reloaded. It does temporarily work before reload, though, and phantoms of size 0 have the attribute persist even after world reload.
How to reproduce
- Summon a phantom
- Run the command
/data merge entity @e[type=minecraft:phantom,limit=1] {Size:40}
- Check the value of the attack damage attribute (for size 40, it defaults to 46).
/attribute @e[type=minecraft:phantom,limit=1] minecraft:generic.attack_damage base get
- Attempt to modify the attack damage attribute:
/attribute @e[type=minecraft:phantom,limit=1] minecraft:generic.attack_damage base set 99
- Observe that the change did stick temporarily and that the value is now 99:
/attribute @e[type=minecraft:phantom,limit=1] minecraft:generic.attack_damage base get
- Reload the world, and then run the above command.
→ The value will have reset to the default of 46 (for size 40).
Code analysis
19w08a no longer sets the attribute when NBT is read (it only modifies the hitbox). However, it does update the attribute (and hitbox) when the size entity metadata changes. Since the size entity metadata defaults to 0, no update is generated when the size is 0, as is the case for all naturally spawned phantoms.