Mojira Archive
MC-88694

Lower absorption effect with different particle settings / visibility replenishes all hearts of higher amplifier effect

The bug

Lost absorption hearts of an absorption effect with high amplifier are regained when absoprtion with a lower amplifier (which should not affect the existing effect at all) and different particle settings (NBT tags Ambient or ShowParticles) or visibility (NBT tag ShowIcon) is applied.

Expected would be that either:

  • the effect with the lower amplifier does not affect the higher amplifier effect (while also considering MC-128682)
  • or (better?) that the absorption effect is removed once all absorption hearts are gone

Note: In 1.12.2 and older versions this also affected lower absorption effects with the same particle settings / visibility, see this comment. E.g. when eating a normal golden apple after absorption hearts from an enchanted golden apple had been used up.

How to reproduce

  1. Give yourself absoprtion with a high amplifier
    /effect give @s minecraft:absorption 1000 10 true
    
  2. Take damage and lose the absorption hearts
    /effect give @s minecraft:instant_damage 1 3 true
    
  3. Give yourself absoprtion with a low amplifier and a different particle visibility
    /effect give @s minecraft:absorption 1 0 false
    

    All absoprtion hearts of the high amplifier effect were replenished

Code analysis

Code analysis by Marcono1234 can be found in this comment.