I'm not sure if this belongs in Commands or Scripting and Mods, since it applies to both.
In more recent versions of Java edition (not sure about bedrock), entity/mob health is capped at 1024; this doesn't seem to be the case in older versions such as 1.7.10 and I'm assuming the change was made in 1.9.
While there aren't any vanilla mobs that use more than 1024 health, this limit restricts the amount of health that mapmakers and modders can give to entities. 1024 health isn't that high to begin with if you consider that the Bedrock Edition's Wither already has 600 health. From what I understand (correct me if I'm wrong) health is stored as a float, which seems to have an upper limit of 3 * 10^38 (or at least much higher than 1024), and even a short goes up to 32,767; so this appears to be a deliberate restriction in the code rather than an integer value limit.
To test the HP cap (done in Minecraft 1.13+):
- Give yourself a +510 damage sword with "give @p minecraft:diamond_sword{AttributeModifiers:[{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:510,Operation:0,UUIDLeast:481256,UUIDMost:947116}]} 1"
- Spawn an 8000 hp creeper with "summon creeper ~ ~ ~ {Attributes:[{Name:generic.maxHealth,Base:8000}],Health:8000f}".
The sword adds 510 damage to the base 1 damage of your hand, doing a total of 511 damage. Hit the creeper twice with the sword and then punch it twice with a bare hand. The creeper should die, which would be expected if its health was 1024, but not if it was 8000.
Please sign in to leave a comment.
1 Comments