mojira.dev
MC-178383

Horses, donkeys, mules and llamas spawned from spawn eggs or /summon command have 53 health

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

  1. Use a spawn egg to spawn a horse

  2. 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

Attachments

Comments

j_p_smith

Confirmed in 20w20b. All horses, donkeys and mules spawned using /summon have 53 health.

j_p_smith

Duplicate of MC-103250.

j_p_smith

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.

Avoma

Can confirm in 20w49a.

Avoma

Can confirm in 20w51a.

Avoma

Can confirm in 21w03a.

Avoma

Can confirm in 1.16.5 and 21w08b.

Avoma

Can confirm in 21w15a.

Avoma

Can confirm in 1.17.

migrated

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.

Avoma

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. 🙂

TkainMinecraft

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.)

ampolive

Can confirm in 1.18 Pre-release 1.

Avoma

Can confirm in 1.18.2 and 22w19a.

Avoma

Can confirm in 1.19.

Avoma

Can confirm in 1.19.2.

[Mod] Jingy

Can confirm in 1.20.2

[Mod] Jingy

Requesting ownership of this issue as the original poster has not been active in the last 3 years.

Wilf233

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

Wilf233

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

Wilf233

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.

[Mod] Jingy

(Unassigned)

Confirmed

Mob spawning

data, horse, summon

20w15a, 20w20b, 1.16.1, 20w30a, 1.16.2, ..., 1.20.2, 1.20.4, 23w51b, 24w07a, 24w14a

24w19a

Retrieved