mojira.dev
MC-93830

Wolf tail height is not based on ratio of Health to maxHealth

The height of a wolf's tail which is indicating if a wolf is hurt is not based on the ration of Health to maxHealth but instead on the ration of Health to 20.

This causes wild wolves which have 8 of 8 health to display as hurt.

Example command

/summon Wolf ~ ~ ~ {Attributes:[{Name:"generic.maxHealth",Base:0.5d}],Health:0.5f}

Linked issues

Comments 6

Confirmed. From 1.8 MCP EntityWolf class:

return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F));

The 20.0F could instead receive the maxHealth attribute value. Note that currently, tame wolves cannot have their maxHealth changed via commands (as it will always revert back to 20.0 when tame).

Example using "getMaxHealth", which returns the generic.maxHealth attribute value of the entity:

return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (this.getMaxHealth() - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F));

EDIT: Actually according to the snippet, untamed wolves will have a tail height of (pi / 5) at all times, rather than being dependent on its Health value. This suggests it's intended for untamed wolves. While the problem is still potentially present for tame wolves, tame wolves can only ever have a maxHealth of 20.0.

I don't know if this is a bug but also if you provide an invalid UUID the value for generic.maxHealth is defaulted to 8d instead of the provided value.

[Mod] redstonehelper

@@unknown: Not a bug in my opinion.

I think this report is valid because the fact that the tamed wolf is not using the set maxHealth value is MC-71977, which means that they should support different maxHealth values which makes this report valid I assume

[Mod] redstonehelper

This report is valid, invalid UUID defaulting maxHealth isn't.

No what I meant is that it uses the default value instead of the provided one, which sounds like MC-71977

marcono1234

Erik Broes

Community Consensus

health, maxHealth, tail, wolf

Minecraft 15w49b

Minecraft 16w21a

Retrieved