I'm trying to add custom attack animation to my entity. I thought this way it could work, but the animation does not get triggered at all. I want the animation to be played only when the entity actually deals damage to the target. When I use only query.can_damage_nearby_mobs the animation plays all the time. Ty for the answers in advance. Minecraft Stable version
"controller.animation.animal.hit" : {
"initial_state" : "default",
"states" : {
"attack" : {
"animations" : [ "attack" ],
"transitions": [
{
"default" : "!variable.has_target || variable.attack_time < 0.0 && !query.can_damage_nearby_mobs"
}
]
},
"default" : {
"transitions" : [
{
"attack": "variable.has_target && variable.attack_time >= 0.0 && query.can_damage_nearby_mobs"
}
]
}
}
}