## Regular golden apples don't increase the number of gold hearts if you previously ate an enchanted golden apple and then took damage

XMLWordPrintable
• Bug
• Resolution: Fixed
• 23w31a, 23w32a, 23w33a, 23w35a
• Player
• Important
• Platform

### The bug

If you eat an enchanted golden apple, take damage until you have barely any gold hearts left, and then eat a regular golden apple to try to get more gold hearts, the regular golden apple does not increase the number of gold hearts that you have.

### To reproduce

1. Eat an enchanted golden apple.
2. Stand next to a cactus to take damage until you only have half of a gold heart left. Then quickly step away from the cactus.
3. Eat a regular golden apple.
4. You still only have half of a gold heart, even though regular golden apples usually give you 2 gold hearts.

### Observed behavior

Regular golden apples do not provide an absorption benefit.

### Expected behavior

It's unclear what the most intuitive behavior would be, but I can imagine 2 reasonable possibilities. Which one is better is a matter of opinion, but either of these would be better than the current behavior.
Possibility 1: Reset number of gold hearts to the number normally given by the regular golden apple
When the player eats the regular golden apple, their gold hearts should increase from 0.5 to 2 because the regular golden apple is "resetting" the gold hearts to the number it normally gives. (If the player were to eat the regular golden apple while having more than 2 gold hearts, they would retain that higher number of gold hearts until the higher level of absorption runs out of time, and then the number of gold hearts would decrease to 2.)
Possibility 2: Accumulate gold hearts until you hit the max for the highest level of absorption that you currently have
When the player eats the regular golden apple, their gold hearts should increase from 0.5 to 2.5 because regular golden apples should provide you with the full 2 hearts that they usually do. If the player were to then immediately eat another regular golden apple, the gold hearts would increase from 2.5 to 4.5. Another regular golden apple would increase it from 4.5 to 6.5. Eating a fourth regular golden apple would increase it from 6.5 to only 8 because the maximum number of gold hearts that an enchanted golden apple allows you to maintain is 8. Eating subsequent regular golden apples would not increase the gold hearts beyond 8. When the high level of absorption from the enchanted golden apple runs out of time, the number of gold hearts would decrease from 8 to 2 because the maximum number of gold hearts that a regular golden apple can maintain is 2. (This is similar to how the gold hearts accumulate in MC-264657.)

[Mojang] SystemInvecklare
[Helper] pine1needle