{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.entity.regular_staff.skill_attack": {
      "states": {
        "default": {
          "transitions": [
            {
              "windup": "q.property('attack:state') == 'skill' && q.scoreboard('stun') == 0 && q.scoreboard('has_skill') == 0"
            }
             ],
          "on_entry": [
            "/tag @s remove cantBlock",
            "/event entity @s[scores={stun=0}] cooldownAttack"
            ]
        },
        "windup": {
            "animations": [
              "regular_staff.cast"
              ],
          "transitions": [
            {
              "default": "q.scoreboard('stun') > 0"
            },
            {
              "attack": "q.any_animation_finished"
            }
            ],
          "on_entry": [
            "/event entity @s attack_state:skill",
            "/scoreboard players random @s skillatk_cd 30 60",
            "/playanimation @s animation.regular_staff.cast"
            ],
          "on_exit": [
            "/scoreboard players random @s skillatk_cd 30 60"
            ]
        },
        "attack": {
          "transitions": [
            {
              "default": "q.scoreboard('stun') > 0 || q.any_animation_finished && q.scoreboard('skillatk_cd') == 0"
            }
            ],
            "animations": [
              {"regular_staff.cast_held":"q.scoreboard('skillatk_cd') > 0"}
              ],
            "on_entry": [
              "/tag @s add cantBlock",
              "@s movement:stop",
              "/event entity @s attack_state:skill",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.regular_staff.cast_held"
              ],
            "on_exit": [
              "/event entity @s attack_state:idle",
              "/event entity @s[scores={stun=0}] movement:walk",
              "/scoreboard players set @s has_skill 0",
              "/tag @s remove hasSkill"
              ]
        }
      }
    }
  }
}