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.
/summon Wolf ~ ~ ~ {Attributes:[{Name:"generic.maxHealth",Base:0.5d}],Health:0.5f}
Linked Issues
Created Issue:
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.
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}
relates to
The bug
When you summon a mob only with a given value for the generic.max_health attribute the value for the Health tag is the default health value of this mob which can be higher than the value of the attribute generic.max_health. If you however provide the Health tag, the attribute value is used as maximum value.
How to reproduce
- Use the following command
/summon wolf ~ ~ ~ {Attributes:[{Name:"generic.max_health",Base:0.1d}]} - Inspect the NBT data
/data get entity @e[type=wolf,limit=1] Health
The Health value is the default 8f which is larger than the maximum - Use the following command
Health provided
/summon wolf ~ ~ ~ {Attributes:[{Name:"generic.max_health",Base:0.1d}],Health:8f} - Inspect the NBT data
/data get entity @e[type=wolf,limit=1] Health
Its Health value is now the value of the generic.max_health attribute
Wrong max_health value is used
Not reproducible anymore in 20w07a (and probably earlier) because when summoning tame wolves their Health is set as well.
Based on Skylinerw's comment on MC-93830 it also appears that the game is not using the value for the generic.max_health attribute the mob has at the end.
The following command will cause Health to be set to the maximum value defined by the generic.max_health attribute in the command, however the game overrides this value with the default 20d. This means the Health value of 2f would have been valid.
/summon wolf ~ ~1 ~ {OwnerUUID:"00000000-0000-0000-0000-000000000000",Attributes:[{Name:"generic.max_health",Base:0.1d}],Health:2f}
Confirmed. From 1.8 MCP EntityWolf class:
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:
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.
@Marcono1234: 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 assumeThis 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