The Bug
AbstractHorse
entities can have up to 53 health points.
Expected Behavior
Any AbstractHorse
creature should have a maximum of 25 health points.
How to reproduce
Use a spawn egg to spawn a horse
Inspect the horse's health:
/data get entity @e[type=horse,limit=1,sort=nearest] Health
→ ❌ The horse has 53 health
Code Analysis
The questionable value can be found in the AbstractHorse
class:
public static AttributeSupplier.Builder createBaseHorseAttributes() {
return Mob.createMobAttributes().add(Attributes.JUMP_STRENGTH).add(Attributes.MAX_HEALTH, 53.0D).add(Attributes.MOVEMENT_SPEED, 0.22499999403953552D);
}
Linked issues
is duplicated by
relates to
Attachments
Comments


Duplicate of MC-103250.

This should probably be reopened, as it actually affects horses, donkeys and mules spawned using spawn eggs. This was not the case in 1.15.2 or earlier.
Can confirm in 20w49a.
Can confirm in 20w51a.
Can confirm in 21w03a.
Can confirm in 1.16.5 and 21w08b.
Can confirm in 21w15a.
Can confirm in 1.17.

Occurs in both 1.16.5 and 1.17.1.
Not just horses. it's anything based on the abstract horse class.
I.e. That means horses, donkeys, mules, llamas... and anything else I might have forgotten.
I'd like to request ownership of this ticket since the current reporter has been inactive since April of 2020. I'm willing to keep this report updated and will continue to provide all of the necessary information. 🙂

Found the code issue that gives way to this bug; there's this method below in the (Official MojMap) AbstractHorse
class, and...
public static AttributeSupplier.Builder createBaseHorseAttributes() {
return Mob.createMobAttributes().add(Attributes.JUMP_STRENGTH).add(Attributes.MAX_HEALTH, 53.0D).add(Attributes.MOVEMENT_SPEED, 0.22499999403953552D);
}
...well, I'll let you guys find the odd number out. (Hint: It's not the second one.)

Can confirm in 1.18 Pre-release 1.
Can confirm in 1.18.2 and 22w19a.
Can confirm in 1.19.
Can confirm in 1.19.2.
Can confirm in 1.20.2
Requesting ownership of this issue as the original poster has not been active in the last 3 years.

Naturally spawned horse is sometimes 53 in health, sometimes not.

If you exit the game and reenter, the health returns normal.

The root of this bug is that health value is not initiated in NBT when spawned. Instead, only maximum health value is initiated.
To fix this bug, just to initiate both health value and maximum health value when spawned.
Confirmed in 20w20b. All horses, donkeys and mules spawned using /summon have 53 health.