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 21

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

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.

11 more comments

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.

Amy Lee Lay

[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