{
  "format_version": "1.21.0",
  "animation_controllers": {
    "controller.animation.imcooked": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "cooked": "q.health <= 50"
            }
            ],
          "on_exit": [
            "/event entity @s imcooked"
            ]
        },
        "cooked": {
          "transitions": [
            {
              "default": "q.health > 50"
            },
            {
              "verycooked": "q.health <= 10"
            }
            ]
        },
        "verycooked": {
          "transitions": [
            {
              "cooked": "q.health > 10"
            }
            ],
          "on_entry": [
            "@s verycooked"
            ]
        }
      }
    },
    "controller.animation.player.headrot": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "down": "q.target_x_rotation > 10"
            },
            {
              "up": "q.target_x_rotation < -10"
            }
            ],
            "on_entry": [
              "/scoreboard players set @s headrot 0"
              ]
        },
        "down": {
          "transitions": [
            {
              "default": "q.target_x_rotation < 11"
            },
            {
              "lower": "q.target_x_rotation > 20"
            }
            ],
            "on_entry": [
              "/scoreboard players set @s headrot -1"
              ]
        },
        "lower": {
          "transitions": [
            {
              "down": "q.target_x_rotation < 21"
            },
            {
              "bottom": "q.target_x_rotation > 30"
            }
            ],
            "on_entry": [
              "/scoreboard players set @s headrot -2"
              ]
        },
        "bottom": {
          "transitions": [
            {
              "lower": "q.target_x_rotation < 31"
            },
            {
              "ground": "q.target_x_rotation >= 40"
            }
            ],
            "on_entry": [
              "/scoreboard players set @s headrot -3"
              ]
        },
        "ground": {
          "transitions": [
            {
              "bottom": "q.target_x_rotation < 40"
            },
            {
              "floor": "q.target_x_rotation >= 44"
            }
            ],
            "on_entry": [
              "/scoreboard players set @s headrot -4"
              ]
        },
        "floor": {
          "transitions": [
            {
              "ground": "q.target_x_rotation < 44"
            }
            ],
            "on_entry": [
              "/scoreboard players set @s headrot -5",
              "/tag @s add head:floor"
              ],
            "on_exit": [
              "/tag @s remove head:floor"
              ]
        },
        "up": {
          "transitions": [
            {
              "default": "q.target_x_rotation > -11"
            },
            {
              "higher": "q.target_x_rotation < -20"
            }
            ],
            "on_entry": [
              "/scoreboard players set @s headrot 1"
              ]
        },
        "higher": {
          "transitions": [
            {
              "up": "q.target_x_rotation > -22.26"
            },
            {
              "top": "q.target_x_rotation < -30"
            }
            ],
            "on_entry": [
              "/scoreboard players set @s headrot 2"
              ]
        },
        "top": {
          "transitions": [
            {
              "higher": "q.target_x_rotation > -31"
            },
            {
              "sky": "q.target_x_rotation <= -40"
            }
            ],
            "on_entry": [
              "/scoreboard players set @s headrot 3"
              ]
        },
        "sky": {
          "transitions": [
            {
              "top": "q.target_x_rotation > -40"
            },
            {
              "ceiling": "q.target_x_rotation <= -44"
            }
            ],
            "on_entry": [
              "/scoreboard players set @s headrot 4"
              ]
        },
        "ceiling": {
          "transitions": [
            {
              "sky": "q.target_x_rotation > -44"
            }
            ],
            "on_entry": [
              "/scoreboard players set @s headrot 5",
              "/tag @s add head:ceiling"
              ],
            "on_exit": [
              "/tag @s remove head:ceiling"
              ]
        }
      }
    },
    "controller.animation.combat.basic": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "intoworld": "q.is_alive"
            }
            ]
        },
        "intoworld": {
          "transitions": [
            {
              "idle": "q.is_alive"
            }
            ],
          "on_exit": [
            "/tag @s remove grab:entityB",
            "/tag @s remove grab:entityA",
            "/scoreboard players set @s stun 0",
            "/scoreboard players set @s emotionP 0",
            "/scoreboard players set @s stamina 1"
            ],
          "on_entry": [
            "/gamerule commandblockoutput false",
            "/gamerule sendcommandfeedback false",
            "/function spawnWorld",
            "/function setScoreboardObjectives",
            "/execute as @s at @s run function fixScores"
            ]
        },
        "idle": {
          "transitions": [
            {
              "intoworld": "!q.is_alive"
            },
            {
              "stun": "q.scoreboard('stun') > 0"
            },
            {
              "block": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:combat') && !q.is_jumping && q.is_sneaking && q.all_animations_finished && q.scoreboard('has_skill') == 0 && q.scoreboard('stamina') > 0 && q.scoreboard('stun') == 0 && q.scoreboard('disableBlock') == 0 && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:cantblock')"
            },
            {
              "dash": "q.is_sneaking && q.is_jumping && q.scoreboard('has_skill') == 0 && q.equipped_item_any_tag('slot.weapon.mainhand','weapon:combat') && q.scoreboard('stun') == 0  && q.scoreboard('dash_cd') == 0 && q.scoreboard('stamina') > 44 && q.scoreboard('basic_act') == 0 && q.scoreboard('headrot') > -5"
            }
            ],
          "on_entry": [
            "/scoreboard objectives add kbVerti dummy",
            "/scoreboard objectives add kbHori dummy",
            "/inputpermission set @s lateral_movement enabled",
            "/inputpermission set @s jump enabled",
            "/scoreboard players set @s[scores={emotionP=..-50}] emotionP 25"
            ]
        },
        "stun": {
          "transitions": [
            {
              "intoworld": "!q.is_alive"
            },
            {
              "idle": "q.scoreboard('stun') == 0"
            },
            {
              "burst": "q.is_jumping && q.scoreboard('stamina') > 51 && q.scoreboard('emotionP') > -30 && q.scoreboard('burst_cd') == 0 && q.scoreboard('inGrab') == 0"
            }
            ],
          "on_entry": [
            "/inputpermission set @s lateral_movement disabled",
            "/inputpermission set @s[scores={burst_cd=1..}] jump disabled"
            ],
          "on_exit": [
            "/scoreboard players set @s[scores={emotionP=..-50}] stamina -200"
            ]
        },
        "dash": {
          "animations": [
            "playerCombat.dash"
            ],
          "transitions": [
            {
              "intoworld": "!q.is_alive"
            },
            {
              "idle": "q.scoreboard('stun') > 0 || q.all_animations_finished && !q.is_sneaking"
            },
            {
              "block": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:combat') && !q.is_jumping && q.is_sneaking && q.all_animations_finished && q.scoreboard('has_skill') == 0 && q.scoreboard('stamina') > 0 && q.scoreboard('stun') == 0 && q.scoreboard('disableBlock') == 0 && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:cantblock')"
            }
            ],
            "on_entry": [
              "/scoreboard players set @s kbHori 25",
              "/scoreboard players set @s kbVerti 1",
              "@s invincibility:on",
              "/event entity @s no_kb:resistance",
              "@s body_rotation:blocked",
              "/tag @s add dashing",
              "/scoreboard players remove @s[tag=!soul:determination] stamina 40",
              "/scoreboard players remove @s[tag=soul:determination] stamina 30",
              "/scoreboard players set @s dashing 1",
              "/scoreboard players set @s block 1"
              ],
            "on_exit": [
              "/scoreboard players set @s kbHori 0",
              "/scoreboard players set @s kbVerti 0",
              "@s invincibility:off",
              "/event entity @s[tag=superarmor,tag=stunImmune] kb:resistance",
              "@s body_rotation:enabled",
              "/tag @s remove iframes",
              "/tag @s remove dashing",
              "/scoreboard players set @s dashing 0",
              "/scoreboard players set @s block 0",
              "/tag @s remove movementDetect"
              ]
        },
        "block": {
          "transitions": [
            {
              "intoworld": "!q.is_alive"
            },
            {
              "idle": "!q.is_sneaking || q.scoreboard('stun') > 0 || q.scoreboard('has_skill') > 0"
            }
            ],
          "on_entry": [
            "@s movement:walk",
            "@s invincibility:on",
            "/tag @s add blocking",
            "/scoreboard players set @s[tag=trait:longparry,scores={parryCD=0},tag=!trait:noparry] parry 10",
            "/scoreboard players set @s[tag=!trait:longparry,scores={parryCD=0},tag=!trait:noparry] parry 5",
            "/scoreboard players set @s block 80"
            ],
          "on_exit": [
            "/event entity @s[tag=sprintClick] movement:sprint",
            "@s invincibility:off",
            "/tag @s remove blocking",
            "/scoreboard players set @s block 0",
            "/scoreboard players set @s[tag=!trait:longparrycd] parryCD 5",
            "/scoreboard players set @s[tag=trait:longparrycd] parryCD 30"
            ]
        },
        "burst": {
          "transitions": [
            {
              "idle": "q.is_alive"
            }
            ],
          "on_entry": [
            "/tag @s add applyKB",
            "/scoreboard players set @s hitboxRange 35",
            "/scoreboard players set @s damageOutput 5",
            "/scoreboard players set @s stunTime 5",
            "/scoreboard players set @s burst_cd 100",
            "/summon combat:burst",
            "/scoreboard players set @s stun 0",
            "/scoreboard players remove @s stamina 50",
            "/scoreboard players remove @s[tag=!trait:expensiveburst] emotionP 15",
            "/scoreboard players remove @s[tag=trait:expensiveburst] emotionP 30"
            ],
          "on_exit": [
            "/tag @s remove hitboxIframes",
            "/function attacks/radius",
            "@s roar4"
            ]
        }
      }
    },
    "controller.animation.player.blockdetect": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "armed": "q.is_alive"
            }
            ]
        },
        "armed": {
          "transitions": [
            {
              "cantblock": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:cantblock')"
            }
            ],
          "on_entry": [
            "/scoreboard players set @s disableBlock 0"
            ]
        },
        "cantblock": {
          "transitions": [
            {
              "armed": "!q.equipped_item_any_tag('slot.weapon.mainhand','weapon:cantblock') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset')"
            }
            ],
          "on_entry": [
            "/scoreboard players set @s disableBlock 1"
            ]
        }
      }
    },
    "controller.animation.player.hasWeapon": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "enabled": "!q.equipped_item_any_tag('slot.weapon.mainhand','weapon_queue:v2') && q.equipped_item_any_tag('slot.weapon.mainhand','weapon:combat') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset')"
            },
            {
              "enabledV2": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon_queue:v2') && q.equipped_item_any_tag('slot.weapon.mainhand','weapon:combat') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset')"
            }
            ],
            "on_entry": [
              "/tag @s remove movement:laydown",
              "/tag @s remove combat:enabled",
              "/event entity @s weapon_name:none",
              "/event entity @s weapon_equip:unarmed"
              ]
        },
          "noWeapon": {
            "transitions": [
              {
                "default": "q.scoreboard('weaponTimer')==0"
              }
              ],
            "on_entry": [
              "/tag @s remove combat:enabled"
              ]
          },
          "enabled": {
            "transitions": [
              {
                "swimming": "q.swim_amount > 0 || q.is_crawling || q.is_riding"
              },
              {
                "enabledV2": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon_queue:v2') && q.equipped_item_any_tag('slot.weapon.mainhand','weapon:combat') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset')"
              },
              {
                "noWeapon": "!q.equipped_item_any_tag('slot.weapon.mainhand','weapon:combat') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset')"
              }
              ],
            "on_entry": [
              "/tag @s add combat:enabled",
              "/event entity @s weapon_equip:armed",
              "/event entity @s weapon_name:remove2"
              ]
          },
          "enabledV2": {
            "transitions": [
              {
                "swimming": "q.swim_amount > 0 || q.is_crawling || q.is_riding"
              },
              {
                "enabled": "!q.equipped_item_any_tag('slot.weapon.mainhand','weapon_queue:v2') && q.equipped_item_any_tag('slot.weapon.mainhand','weapon:combat') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset')"
              },
              {
                "noWeapon": "!q.equipped_item_any_tag('slot.weapon.mainhand','weapon:combat') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset')"
              }
              ],
            "on_entry": [
              "/tag @s add weapon:v2",
              "/tag @s add combat:enabled",
              "/event entity @s weapon_equip:armed",
              "/event entity @s weapon_name:remove1"
              ],
            "on_exit": [
              "/tag @s remove weapon:v2"
              ]
          },
          "swimming": {
            "transitions": [
              {
                "default": "q.swim_amount == 0 && !q.is_crawling && !q.is_riding"
              }
              ],
            "on_entry": [
              "/tag @s add movement:laydown"
              ],
            "on_exit": [
              "/tag @s remove movement:laydown"
              ]
          }
        }
      },
    //inputClick_detector(
    "controller.animation.player.sprintClick": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "sprint": "q.is_sprinting"
            }
            ],
            "on_entry": [
              "/event entity @s movement:walk",
              "/tag @s remove sprintClick",
              "/scoreboard players set @s sprintClick 0"
              ]
        },
          "sprint": {
            "transitions": [
              {
                "default": "!q.is_sprinting"
              }
              ],
            "on_entry": [
              "/event entity @s movement:sprint",
              "/tag @s add sprintClick"
              ]
          }
        }
      },
    "controller.animation.player.sneakClick": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "sneak": "q.is_sneaking"
            }
            ],
            "on_entry": [
              "/tag @s remove sneakClick",
              "/scoreboard players set @s sneakClick 0"
              ]
        },
          "sneak": {
            "transitions": [
              {
                "default": "!q.is_sneaking"
              }
              ],
            "on_entry": [
              "/tag @s add sneakClick"
              ]
          }
        }
      },
    "controller.animation.player.leftClick": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "left": "v.attack_time > 0.0"
            }
            ],
            "on_entry": [
              "/tag @s remove leftClick",
              "/scoreboard players set @s leftClick 0"
              ]
        },
          "left": {
            "transitions": [
              {
                "default": "v.attack_time == 0"
              }
              ],
            "on_entry": [
              "/tag @s add leftClick"
              ]
          }
        }
      },
    "controller.animation.player.rightClick": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "right": "q.is_using_item"
            }
            ],
            "on_entry": [
              "/tag @s remove rightClick",
              "/scoreboard players set @s rightClick 0"
              ]
        },
          "right": {
            "transitions": [
              {
                "default": "!q.is_using_item"
              }
              ],
            "on_entry": [
              "/tag @s add rightClick"
              ]
          }
        }
      },
    "controller.animation.player.jumpClick": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "jump": "q.is_jumping"
            }
            ],
            "on_entry": [
              "/tag @s remove jumpClick",
              "/scoreboard players set @s jumpClick 0"
              ]
        },
          "jump": {
            "transitions": [
              {
                "default": "!q.is_jumping"
              }
              ],
            "on_entry": [
              "/tag @s add jumpClick"
              ]
          }
        }
      }
      //)
  }
}