{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.bowrev2.ct": {
      "states": {
        "default": {
          "transitions": [
            {
              "ready": "q.is_alive"
            }
            ]
        },
        "ready": {
          "transitions": [
            {
              "armed": "q.equipped_item_any_tag('slot.weapon.mainhand','weapon:bowrev2')"
            }
            ],
          "on_entry": [
            "/scoreboard players set @s ba_attacking 0",
            "/tag @s remove basicAttack",
            "/scoreboard players set @s has_skill 0",
            "/event entity @s[scores={weaponTimer=0}] weapon_equip:unarmed",
            "/event entity @s[scores={weaponTimer=0}] weapon_name:none"
            ],
          "on_exit": [
            "/event entity @s weapon_equip:armed",
            "/event entity @s weapon_name2:bowrev2",
            "/event entity @s weapon_name:remove1"
            ]
        },
        "cooldown": {
          "transitions": [
            {
              "armed": "q.scoreboard('ba_cd') == 0"
            },
            {
              "ready": "q.all_animations_finished && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:anim') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
            ],
          "on_entry": [
            "/scoreboard players set @s basic_attack 0"
            ]
        },
        "armed": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('ba_cd') > 0"
            },
            {
              "pull": "q.property('weapon:name2')==3 && q.is_using_item && q.scoreboard('stun') == 0 && !q.is_sprinting && !q.is_jumping && !q.is_sneaking && q.scoreboard('block') == 0 && q.scoreboard('has_skill') == 0"
            },
            {
              "ready": "q.all_animations_finished && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:anim') && !q.equipped_item_any_tag('slot.weapon.mainhand','weapon:moveset') && q.scoreboard('stun') == 0"
            }
             ],
          "on_entry": [
            "/scoreboard players set @s[scores={basic_attack=1..}] basic_attack 0"
            ],
            "on_exit": [
              "/scoreboard players add @s basic_attack 1"
              ]
        },
        "pull": {
          "animations": [
            "bowrev2.pull"
            ],
          "transitions": [
            {
              "ammoCheck": "q.any_animation_finished && q.scoreboard('stun') == 0"
            },
            {
              "armed": "q.scoreboard('stun') > 0"
            }
            ],
          "on_entry": [
            "/playanimation @s animation.bowrev2.pull"
            ]
        },
        "ammoCheck": {
          "on_entry": [
            "/scoreboard players set @s[hasitem={item=arrow,quantity=1..}] scoredummy 1",
            "/scoreboard players set @s[hasitem={item=arrow,quantity=0}] scoredummy 0",
            "/tellraw @s[hasitem={item=arrow,quantity=0}] {\"rawtext\":[{\"text\":\"§4§oThis Interaction requires §rArrow(1x)§o§4.\"}]}"
            ],
          "on_exit": [
            "/clear @s[scores={scoredummy=1}] arrow 0 1"
            ],
          "transitions": [
            {
              "aim": "q.scoreboard('scoredummy') == 1"
            },
            {
              "armed": "q.scoreboard('scoredummy') == 0"
            }
            ]
        },
        "aim": {
          "animations": [
            "bowrev2.aim"
            ],
          "transitions": [
            {
              "fire": "!q.is_using_item && q.scoreboard('stun') == 0"
            },
            {
              "armed": "q.scoreboard('stun') > 0 || q.is_sprinting"
            }
            ],
          "on_entry": [
            "/playanimation @s animation.bowrev2.aim"
            ]
        },
        "fire": {
          "transitions": [
            {
              "cooldown": "q.scoreboard('ba_cd') > 0"
            },
            {
              "armed": "q.any_animation_finished && q.scoreboard('ba_cd') == 0 || q.scoreboard('stun') > 0"
            }
            ],
            "animations": [
              "bowrev2.fire"
              ],
            "on_entry": [
              "/scoreboard players set @s ba_attacking 1",
              "/tag @s add basicAttack",
              "/scoreboard players set @s ba_reset 0",
              "/playanimation @s animation.bowrev2.fire"
              ],
            "on_exit": [
              "/scoreboard players set @s ba_attacking 0",
              "/tag @s remove basicAttack",
              "/scoreboard players set @s[scores={basic_attack=1..}] ba_cd 0"
              ]
        }
      }
    }
  }
}