{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.entity.irongolemre.ct": {
      "states": {
        "default": {
          "transitions": [
            {
              "attack": "q.property('attack:state') == 'basic1' && q.scoreboard('stun') == 0 && q.scoreboard('has_skill') == 0"
            }
             ],
          "on_entry": [
            "/event entity @s[scores={stun=0}] cooldownAttack",
            "/scoreboard players set @s[scores={basic_attack=4..}] basic_attack 0"
            ],
          "on_exit": [
              "/scoreboard players add @s basic_attack 1"
              ]
        },
        "attack": {
          "transitions": [
            {
              "default": "q.scoreboard('stun') > 0"
            },
            {
              "basic2": "q.any_animation_finished"
            }
            ],
            "animations": [
              "irongolemre.basic1"
              ],
            "on_entry": [
              "/scoreboard players set @s block 0",
              "/event entity @s[scores={stun=0}] movement:walk",
              "/scoreboard players set @s ba_attacking 1",
              "/tag @s add basicAttack",
              "/scoreboard players set @s ba_reset 40",
              "/playanimation @s animation.irongolemre.basic1"
              ],
            "on_exit": [
              "/scoreboard players set @s ba_attacking 0",
              "/tag @s remove basicAttack"
              ]
        },
        "basic2": {
          "transitions": [
            {
              "default": "q.scoreboard('stun') > 0"
            },
            {
              "basic3": "q.any_animation_finished"
            }
            ],
            "animations": [
              "irongolemre.basic2"
              ],
            "on_entry": [
              "/event entity @s attack_state:basic2",
              "/scoreboard players set @s ba_attacking 1",
              "/tag @s add basicAttack",
              "/scoreboard players set @s ba_reset 40",
              "/playanimation @s animation.irongolemre.basic2"
              ],
            "on_exit": [
              "/scoreboard players set @s ba_attacking 0",
              "/tag @s remove basicAttack"
              ]
        },
        "basic3": {
          "transitions": [
            {
              "default": "q.scoreboard('stun') > 0"
            },
            {
              "basic4": "q.any_animation_finished"
            }
            ],
            "animations": [
              "irongolemre.basic3"
              ],
            "on_entry": [
              "/event entity @s attack_state:basic3",
              "/scoreboard players set @s ba_attacking 1",
              "/tag @s add basicAttack",
              "/scoreboard players set @s ba_reset 40",
              "/playanimation @s animation.irongolemre.basic3"
              ],
            "on_exit": [
              "/scoreboard players set @s ba_attacking 0",
              "/tag @s remove basicAttack"
              ]
        },
        "basic4": {
          "transitions": [
            {
              "default": "q.scoreboard('stun') > 0 || q.any_animation_finished"
            }
            ],
            "animations": [
              "irongolemre.basic4"
              ],
            "on_entry": [
              "/event entity @s attack_state:basic4",
              "/scoreboard players set @s ba_attacking 1",
              "/tag @s add basicAttack",
              "/scoreboard players set @s ba_reset 40",
              "/playanimation @s animation.irongolemre.basic4"
              ],
            "on_exit": [
              "/scoreboard players set @s ba_attacking 0",
              "/tag @s remove basicAttack"
              ]
        }
      }
    },
    "controller.animation.entity.irongolemre.grab": {
      "states": {
        "default": {
          "transitions": [
            {
              "attack": "q.property('attack:state') == 'grab' && q.scoreboard('stun') == 0 && q.scoreboard('has_skill') == 0"
            }
             ],
          "on_entry": [
            "@s ridedisable",
            "/tag @s remove grab:entityA",
            "/tag @s remove regsword:grab",
            "/event entity @s[scores={stun=0}] cooldownAttack"
            ]
        },
        "attack": {
          "transitions": [
            {
              "default": "q.scoreboard('stun') > 0 || q.scoreboard('grab_sensor') == 0 && q.any_animation_finished"
            },
            {
              "hit": "q.scoreboard('grab_sensor') == 1 && q.any_animation_finished && q.scoreboard('stun') == 0"
            }
            ],
            "animations": [
              "irongolemre.grab"
              ],
            "on_entry": [
              "/execute as @p[tag=dev1] at @s run say GRABBING someone",
              "/scoreboard players set @s combatTag -1",
              "@s movement:stop",
              "@s attack_state:grab",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.irongolemre.grab"
              ],
            "on_exit": [
              "/tag @s add irongolemre:grab",
              "/execute as @s[scores={stun=0}] at @s run playanimation @e[tag=grab:entityB,c=1] animation.irongolemre.grab.hit.victim",
              "/tag @s add grab:entityA",
              "/scoreboard players set @s has_skill 0",
              "/tag @s remove hasSkill",
	            "/execute as @s[scores={grab_sensor=1}] at @s run playanimation @e[tag=grab:entityB,c=1] animation.irongolemre.grab.hit.victim"
              ]
        },
        "hit": {
          "transitions": [
            {
              "default": "q.any_animation_finished || q.scoreboard('stun') > 0"
            }
            ],
          "animations": [
            "irongolemre.grab.hit"
            ],
            "on_entry": [
              "/execute as @p[tag=dev1] at @s run say grabbed someone",
              "/tag @s add grab:entityA",
              "/tag @s add iframes",
              "/event entity @s movement:stop",
	            "/playanimation @e[tag=grab:entityB,c=1] animation.irongolemre.grab.hit.victim",
              "@s movement:stop",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.irongolemre.grab.hit"
              ],
            "on_exit": [
              "@s ridedisable",
              "/tag @s remove iframes",
              "/tag @s remove grab:entityA",
              "/tag @e[c=1,tag=grab:entityB] remove grab:entityB",
            "/scoreboard players random @s grabID -10000 10000",
              "/event entity @s body_rotation:enabled",
              "/event entity @s[scores={stun=0}] movement:walk",
              "/tag @s remove holder",
              "/tag @e[c=1,tag=grab] remove grab",
              "/scoreboard players set @s grab_sensor 0",
              "/tag @e remove grab",
              "/tag @s remove hasSkill",
              "/scoreboard players set @s has_skill 0"
              ]
        }
      }
    },
    "controller.animation.entity.irongolemre.charged_attack": {
      "states": {
        "default": {
          "transitions": [
            {
              "attack": "q.property('attack:state') == 'charged' && q.scoreboard('stun') == 0 && q.scoreboard('has_skill') == 0"
            }
             ],
          "on_entry": [
            "/event entity @s[scores={stun=0}] cooldownAttack"
            ]
        },
        "attack": {
          "transitions": [
            {
              "default": "q.scoreboard('stun') > 0 || q.any_animation_finished"
            }
            ],
            "animations": [
              "irongolemre.charged_attack"
              ],
            "on_entry": [
              "@s movement:stop",
              "/event entity @s attack_state:charged",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.irongolemre.charged_attack"
              ],
            "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"
              ]
        }
      }
    },
    "controller.animation.entity.irongolemre.skill_attack": {
      "states": {
        "default": {
          "transitions": [
            {
              "attack": "q.property('attack:state') == 'skill' && q.scoreboard('stun') == 0 && q.scoreboard('has_skill') == 0"
            }
             ],
          "on_entry": [
            "/event entity @s[scores={stun=0}] cooldownAttack"
            ]
        },
        "attack": {
          "transitions": [
            {
              "default": "q.scoreboard('stun') > 0 || q.any_animation_finished"
            }
            ],
            "animations": [
              "irongolemre.skill_attack"
              ],
            "on_entry": [
              "/scoreboard players random @s[scores={petID=0}] petID 0 10000",
              "@s movement:stop",
              "/event entity @s attack_state:skill",
              "/scoreboard players set @s has_skill 1",
              "/tag @s add hasSkill",
              "/playanimation @s animation.irongolemre.skill_attack"
              ],
            "on_exit": [
              "/execute as @e[r=40,type=!neutral:irongolem,scores={stun=1..}] at @s run ride @s[scores={stun=1..},family=!projectile] start_riding @e[type=projectile:dirtthrow,c=1] teleport_rider until_full",
              "/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"
              ]
        }
      }
    }
  }
}