The Bug:
Breedable entities can be fed again after receiving damage causing them to consume multiple items.
Steps to Reproduce:
Summon two pigs a fair distance away from one another and obtain some carrots.
Feed both of the pigs some carrots and attack one of the pigs.
Quickly feed the pig that you just attacked some more carrots.
Take note as to whether or not breedable entities can be fed again after receiving damage causing them to consume multiple items.
Observed Behavior:
Breedable entities can be fed again after receiving damage. This process can be repeated indefinitely causing a loss of items.
Expected Behavior:
Breedable entities would not be able to be fed again after receiving damage.
Related issues
is duplicated by
Attachments
Comments

The information within this ticket was originally provided by myself in a comment on MC-256568, but after some discussion with bug tracker moderators in the Mojira discord, I was guided to create a new ticket regarding this problem which is this one (MC-256738). 🙂
This ticket relates to MC-256568.
I can confirm this behavior.

Are the animals being healed, or are the consuming the items past the point of being healed? And if so, are they being taken out of love mode, or do they start to breed again when no longer panicked?
Certain breedable animals (pigs, cows, sheep, goats, frogs, etc.) that aren't at full health cannot be healed when feeding them their favorite food. When attempting to do this, the said entity becomes in love again and doesn't heal. To my knowledge, the only instance where this concept doesn't exactly apply to breedable entities is with camels. Camels can be fed their favorite food when they're not at full health, causing them to heal and become in love.
With all breedable entities, when they're attacked, they lose their "InLove" NBT tag, causing them to no longer be in love. Looking back, this may be intentional, but I think the part with certain breedable entites not being healed when being fed their favorite food might be a separate issue.