animation controller BP
{
"format_version": "1.10.0",
"animation_controllers": {
"controller.animation.attack": {
"initial_state": "false",
"states": {
"true": {
"on_entry": [
"/say attacking"
],
"transitions": [
{
"false": "variable.attack_time == 0"
}
]
},
"false": {
"on_entry": [
"/say stop attacking"
],
"transitions": [
{
"true": "variable.attack_time > 0"
}
]
}
}
}
}
}
Player.json
{
"format_version": "1.21.0",
"minecraft:entity": {
"description": {
"identifier": "minecraft:player",
"spawn_category": "creature",
"animations": {
"attack": "controller.animation.attack"
},
"is_spawnable": false,
"is_summonable": false
},
// other default stuff ..........