mojira.dev
MC-51626

generic.maxHealth Attribute set mob's health(not max health)incorrectly in spawner

1.Place a command block and set this command

/setblock ~ ~1 ~ minecraft:mob_spawner 0 replace {EntityId:Zombie,SpawnData:{Attributes:[{Name:generic.movementSpeed,Base:0.001},{Name:generic.knockbackResistance,Base:1.0},{Name:generic.maxHealth,Base:400.0},{Name:generic.followRange,Base:20}]}}

2.activate the command block

3. hit the zombie with diamond sword
4. notice that it needs 3-5 hit to kill it even I set maxHealth to 400

5.Place a command block and set this command (It has same NBT tag as previous Zombie)

/summon ~ ~1 ~ Zombie {Attributes:[{Name:generic.movementSpeed,Base:0.001},{Name:generic.knockbackResistance,Base:1.0},{Name:generic.maxHealth,Base:400.0},{Name:generic.followRange,Base:20}]}

6.activate the command block

7. hit the zombie with diamond sword
8.notice that it doesn't die in 3-4 hits

i think that mob that spawn by monster spawner doesn't have its health set to max health
but the summon command set mob's health to max

sorry for my english but i think it is hard to explain

Comments 1

Malformed command, you didn't specify HealF

Example:

summon Zombie ~ ~1 ~ {HealF:1000.0f,Attributes:[{Name:generic.maxHealth,Base:1000.0d}]}

Rodchananat

(Unassigned)

Unconfirmed

Minecraft 14w11b

Retrieved