mojira.dev
MC-33285

Summoning slimes with custom maxHealth attributes does not work

Description:
Summoning slimes (Normal & Lava) with custom maxHealth attributes don't works:

summon magma_cube ~ ~1 ~ {Health:1000.0f,Attributes:[{Name:"generic.maxHealth",Base:1000.0d}]}

But this (with Zombie) works:

summon zombie ~ ~1 ~ {Health:1000.0f,Attributes:[{Name:"generic.maxHealth",Base:1000.0d}]}

Actual: Summoned slimes use default value of maxHealth instead of the one given.
Expected: Should use maxHealth from summon command instead of default.


Code analysis by @unknown can be found in this comment.

Linked issues

Comments 27

Confirmed for 1.7/1.7.1/1.7.2 and all current 1.7.3 snapshots (up to 13w48b). Setting health through any of the tags, be it Health (doesn't work for any mob because HealF is set automatically in /summon commands, which overrides Health), HealF (this is current health, so setting it higher than the maxHealth attribute won't work; setting it to 1 works for other mobs, but not slimes), nor the maxHealth attribute (should raise maximum health but does not).

Other attributes don't work either. Likely related to this, the attackDamage attribute doesn't apply the bonus strength.

I don't know for certain, but I'm assuming this is because slime health and damage are calculated via the Size tag AFTER the application of attributes and HealF, thus overriding the attributes and HealF. That or these tags are just completely ignored with slimes.

The movementSpeed does not work either, but this is probably because slimes jump rather than walk, which the attribute doesn't affect to begin with. followRange is also bugged, but it's wide-spread with other mobs as well (see: https://mojang.atlassian.net/browse/MC-32579 )

knockbackResistance seems to be the only attribute that works with slimes.

Confirmed for 1.7.4 and 14w02c

Can the 'Affects Versions' tags please be updated? I can also confirm it in 1.7.4.

For those looking for work-arounds in 1.8, slimes/magma cubes have had their AI updated to the new (well, old) AI. Currently (14w11b) the issue with their attributes comes from the inability to modify their "Attributes" list directly. However, you can apply the "Equipment" tag that has items that modifies their attributes after-the-fact. All attributes are modifiable including movementSpeed:

/summon LavaSlime ~ ~10 ~ {Size:4,Equipment:[{id:minecraft:stone,Count:1,tag:{AttributeModifiers:[{AttributeName:generic.movementSpeed,Name:"Reduce Speed",Amount:-100,Operation:0,UUIDLeast:1,UUIDMost:1}]}}]}

The above will summon a slime that can only jump in place.

Thanks for the workaround!

Anyways, confirmed in 14w11b and 1.7.5. Can somebody please update the version tags?

17 more comments

Still Present in 17w50a. Not to sound rude, but 1.13 is the "technically better update", so I don't know if this is planned already, but maybe take another look at this bug?

Affects 1.13.1-pre2.

Affects 1.14

Confirmed in 1.14.4 and 19w35a.

Confirmed in 19w45b.

Yoann Petremann

coschevi

Confirmed

Commands

magma_cube, maxHealth, slime

Minecraft 13w39b, Minecraft 1.7.4, Minecraft 1.7.5, Minecraft 14w11b, Minecraft 1.7.6-pre1, ..., Minecraft 1.13.1, Minecraft 1.14, 1.14.4, 19w45a, 19w45b

1.15 Pre-Release 2

Retrieved