#how do i make an anmation controller that tests for armor
1 messages · Page 1 of 1 (latest)
i know abt this but it still doesnt work
this is my code
{
"format_version": "1.10.0",
"animation_controllers": {
"controller.animation.armor_effects": {
"states": {
"default": {
"transitions": [
{
"vampire": "query.is_item_name_any('slot.armor.head') == cube:vampire_hat && query.is_item_name_any('slot.armor.chest') == cube:vampire_chest && query.is_item_name_any('slot.armor.legs') == cube:vampire_leg && query.is_item_name_any('slot.armor.feet') == cube:vampire_boots"
}
]
},
"vampire": {
"transitions": [
{
"default": "!query.is_item_name_any('slot.armor.head') == cube:vampire_hat || !query.is_item_name_any('slot.armor.chest') == cube:vampire_chest || !query.is_item_name_any('slot.armor.legs') == cube:vampire_leg || !query.is_item_name_any('slot.armor.feet') == cube:vampire_boots"
}
],
"on_entry": [ "/effect @s health_boost 10 7 true" ]
}
}
}
}
}
The use is query.is_item_name_any('<str: location', <int: slot>, '<str: namespace:item_name>')
For example, query.is_item_name_any('slot.armor.head', 0, 'minecraft:diamond_helmet') will return true when the player is wearing a diamond helmet
You can surround the query in (), using && to join the queries then use an ! on the return to default transition.
tried it but still nothing
{
"format_version": "1.10.0",
"animation_controllers": {
"controller.animation.armor_effects": {
"states": {
"default": {
"transitions": [
{
"vampire": "query.is_item_name_any('slot.armor.head',0,'cube:vampire_hat') && query.is_item_name_any('slot.armor.chest,0,'cube:vampire_chest') && query.is_item_name_any('slot.armor.legs',0,'cube:vampire_leg') && query.is_item_name_any('slot.armor.feet',0,'cube:vampire_boots')"
}
]
},
"vampire": {
"transitions": [
{
"default": "!query.is_item_name_any('slot.armor.head',0,'cube:vampire_hat') || !query.is_item_name_any('slot.armor.chest,0,'cube:vampire_chest') || !query.is_item_name_any('slot.armor.legs',0,'cube:vampire_leg)' || !query.is_item_name_any('slot.armor.feet',0,'cube:vampire_boots')"
}
],
"on_entry": ["/effect @s health_boost 10 9 true"]
}
}
}
}
}
is there anything i need to do in the manifest file or version changes or anything like tht?
try to use normal armor first, if it's not working then idk
tried and still not working
This is incorrect, I am on phone right now so I will keep this short. Try a query like this (query.is_item_name_any(...) && query.is_item_name_any(...) &&...)
Then use
!(query.is_item_name_any(...) && query.is_item_name_any(...) &&...)
You also need to add an initial state value
I would recommend using a higher format version like 1.19.50
Also 'slot.armor.chest is incorrect as it is missing a closing '
It's also would be faster if you initialize the queries as variables instead, speeding up the process and simplifies the code