The MoLang queries "query.has_any_family" and "query.hurt_time" does not work on the resource side
Partner Rank: 3
Partner Team Reporting: Starfish Studios
Verification builds: ver. 1.16.220.02, build 5685695
Summary:
The MoLang queries "query.has_any_family" and "query.hurt_time" does not work on the resource side.
Impact:
This prevents creators from being able to easily query the entity's family on the resource pack side or querying the entity hurt time in case they want the entity to play some animation when being hurt, having to use behavior animation controllers to query and then apply some additional component to query by the resource side.
Repro Steps:
- Download and install the attached resource pack.
- Join a world with the resource pack enabled.
- Summon a baby zoglin /summon minecraft:zoglin ~ ~ ~ minecraft:as_baby.
- Observe its head.
- Hit this zoglin.
Repro Rate: 3/3
Observed Results:
The baby zoglin is not displaying its head scale animation (noted on step 4). When hitting the zoglin, nothing changes on the zoglin's appearance.
Expected Results:
The zoglin should still display its head scale animation, the provided pack was replaced the "query.is_baby" by "query.has_any_family('zoglin_baby')" on the baby scalling animation (baby zoglin has the 'zoglin_baby' family). It also should have its head invisible when hurt and then visible again after the hurt time, it was set on the zoglin render controller using "query.hurt_time". See the changed codes for the attached resource pack on the Notes section!
Screenshots/Videos attached: No
Regression Builds: None
Notes:
Codes on the zoglin.entity.json:
{
"format_version": "1.10.0",
"minecraft:client_entity": {
"description": {
"identifier": "minecraft:zoglin",
"materials": { "default": "zoglin" },
"textures": {
"default": "textures/entity/zoglin/zoglin"
},
"geometry": {
"default": "geometry.hoglin"
},
"spawn_egg": {
"base_color": "#c66e55",
"overlay_color": "#e6e6e6"
},
"scripts": {
"pre_animation": [
"variable.tcos_right_side = (Math.cos(query.modified_distance_moved * 38.17) * query.modified_move_speed / variable.gliding_speed_value) * 57.3;",
"variable.tcos_left_side = -variable.tcos_right_side;",
"variable.attack_head_rot = Math.sin(variable.attack_time * 180.0) * -37.3;"
],
"animate": [
"walk",
"look_at_target",
{ "attack": "variable.has_target && variable.attack_time >= 0.0" },
{ "hoglin_baby_scaling": "query.has_any_family('zoglin_baby')" } // Replaced "query.is_baby" that should do the same test.
]
},
"animations": {
"walk": "animation.hoglin.walk",
"look_at_target": "animation.hoglin.look_at_target",
"attack": "animation.hoglin.attack",
"hoglin_baby_scaling": "animation.hoglin.baby_scaling"
},
"render_controllers": [ "controller.render.zoglin" ]
}
}
}
Codes on the zoglin.render_controllers.json:
{
"format_version": "1.8.0",
"render_controllers": {
"controller.render.zoglin": {
"geometry": "Geometry.default",
"materials": [ { "*": "Material.default" } ],
"textures": [ "Texture.default" ],
"part_visibility": [
{ "head": "query.hurt_time <= 0" } // Head should only be visible when the entity is not being hurt.
]
}
}
}