{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.silverlabs_nat.crab": {
      "initial_state": "idle",
      "states": {
        "idle": {
          "animations": [
            { "idle": "!q.is_baby" },
            { "baby_idle": "q.is_baby" },
            {
              "swing_right": "!q.is_baby && (q.property('silverlabs_nat:sand_block_interaction_state') == 'try_collect_sand' || v.attack_time > 0.0)"
            },
            { "holding_weapon": "!q.is_baby && v.weapon_or_tool_equipped" }
          ],
          "transitions": [
            {
              "walk": "v.smoothed_move_speed > 0.1 && !q.property('silverlabs_nat:is_dancing') && !q.is_avoiding_mobs && !q.is_sitting"
            },
            {
              "dance": "q.property('silverlabs_nat:is_dancing') && q.is_alive && !q.is_avoiding_mobs && !q.is_sitting"
            },
            { "hide": "q.is_avoiding_mobs && !q.is_sitting" },
            { "sit": "q.is_sitting" }
          ],

          "blend_via_shortest_path": true,
          "blend_transition": 0.5
        },

        "walk": {
          "animations": [
            { "walk": "!q.is_baby" },
            { "baby_walk": "q.is_baby" },
            {
              "swing_right": "!q.is_baby && (q.property('silverlabs_nat:sand_block_interaction_state') == 'try_collect_sand' || v.attack_time > 0.0)"
            },
            { "holding_weapon": "!q.is_baby && v.weapon_or_tool_equipped" }
          ],
          "transitions": [
            {
              "idle": "v.smoothed_move_speed <= 0.1 && !q.property('silverlabs_nat:is_dancing') && !q.is_avoiding_mobs && !q.is_sitting"
            },
            {
              "dance": "q.property('silverlabs_nat:is_dancing') && q.is_alive && !q.is_avoiding_mobs && !q.is_sitting"
            },
            { "hide": "q.is_avoiding_mobs && !q.is_sitting" },
            { "sit": "q.is_sitting" }
          ],

          "blend_via_shortest_path": true,
          "blend_transition": 0.5
        },

        "dance": {
          "animations": [
            { "dance": "!q.is_baby" },
            { "baby_idle": "q.is_baby" },
            {
              "swing_right": "!q.is_baby && (q.property('silverlabs_nat:sand_block_interaction_state') == 'try_collect_sand' || v.attack_time > 0.0)"
            },
            { "holding_weapon": "!q.is_baby && v.weapon_or_tool_equipped" }
          ],
          "transitions": [
            {
              "idle": "(v.smoothed_move_speed <= 0.1 && !q.property('silverlabs_nat:is_dancing')) || !q.is_alive || q.is_sitting"
            },
            {
              "walk": "v.smoothed_move_speed > 0.1 && !q.property('silverlabs_nat:is_dancing') && !q.is_sitting"
            },
            { "hide": "q.is_avoiding_mobs && !q.is_sitting" },
            { "sit": "q.is_sitting" }
          ],

          "blend_via_shortest_path": true,
          "blend_transition": 0.2
        },
        "hide": {
          "animations": [
            { "hide": "!q.is_baby" },
            { "baby_hide": "q.is_baby" }
          ],
          "on_entry": [
            "v.hide_timer = q.is_avoiding_mobs ? 0 : q.life_time + 2.0;",
            "v.hide_start_time = q.life_time;",
            "v.hide_peek_timer = 0;"
          ],
          "transitions": [
            {
              "hide_loop": "q.life_time > (v.hide_start_time ?? 0) + 1.0 && !q.is_sitting"
            },
            {
              "sit": "q.is_sitting"
            }
          ],
          "blend_via_shortest_path": true,
          "blend_transition": 0.0
        },
        "hide_loop": {
          "animations": [
            { "hide_loop": "!q.is_baby && !v.hide_peek_active" },
            { "baby_hide_idle": "q.is_baby && !v.hide_peek_active" }
          ],
          "transitions": [
            {
              "unhide": "!q.is_avoiding_mobs && v.hide_timer > 0 && q.life_time > v.hide_timer && !q.is_sitting"
            },
            {
              "sit": "q.is_sitting"
            }
          ],
          "blend_via_shortest_path": true,
          "blend_transition": 0.0
        },
        "unhide": {
          "animations": [
            { "unhide": "!q.is_baby" },
            { "baby_unhide": "q.is_baby" }
          ],
          "on_entry": [
            "v.unhide_start_time = q.life_time;"
          ],
          "transitions": [
            {
              "idle": "q.life_time > (v.unhide_start_time ?? 0) + 0.5 && v.smoothed_move_speed <= 0.1 && !q.property('silverlabs_nat:is_dancing') && !q.is_sitting"
            },
            {
              "walk": "q.life_time > (v.unhide_start_time ?? 0) + 0.5 && v.smoothed_move_speed > 0.1 && !q.property('silverlabs_nat:is_dancing') && !q.is_sitting"
            },
            {
              "dance": "q.life_time > (v.unhide_start_time ?? 0) + 0.5 && q.property('silverlabs_nat:is_dancing') && q.is_alive && !q.is_sitting"
            },
            {
              "hide": "q.is_avoiding_mobs && !q.is_sitting"
            },
            {
              "sit": "q.is_sitting"
            }
          ],
          "blend_via_shortest_path": true,
          "blend_transition": 0.2
        },
        "sit": {
          "animations": [
            { "sit": "!q.is_baby" },
            { "baby_sit": "q.is_baby" }
          ],
          "on_entry": [
            "v.sit_start_time = q.life_time;"
          ],
          "transitions": [
            {
              "sit_loop": "q.is_sitting && q.state_time >= 0.7"
            }
          ],
          "blend_via_shortest_path": true,
          "blend_transition": 0.1
        },
        "sit_loop": {
          "animations": [
            { "idle": "!q.is_baby" },
            { "baby_idle": "q.is_baby" },
            { "sit_loop": "!q.is_baby" },
            { "baby_sit_idle": "q.is_baby" }
          ],
          "transitions": [
            {
              "unsit": "!q.is_sitting"
            }
          ],
          "blend_via_shortest_path": true,
          "blend_transition": 0.1
        },
        "unsit": {
          "animations": [
            { "unsit": "!q.is_baby" },
            { "baby_unsit": "q.is_baby" }
          ],
          "on_entry": [
            "v.unsit_start_time = q.life_time;"
          ],
          "transitions": [
            {
              "idle": "q.all_animations_finished && v.smoothed_move_speed <= 0.1 && !q.property('silverlabs_nat:is_dancing') && !q.is_avoiding_mobs"
            },
            {
              "walk": "q.all_animations_finished && v.smoothed_move_speed > 0.1 && !q.property('silverlabs_nat:is_dancing') && !q.is_avoiding_mobs"
            },
            {
              "dance": "q.all_animations_finished && q.property('silverlabs_nat:is_dancing') && q.is_alive && !q.is_avoiding_mobs"
            },
            {
              "hide": "q.all_animations_finished && q.is_avoiding_mobs"
            }
          ],
          "blend_via_shortest_path": true,
          "blend_transition": 0.2
        }
      }
    },
    "controller.animation.silverlabs_nat.crab.hide_peek": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "hide_peek": "v.hide_peek_active"
            }
          ],
          "blend_transition": 0.0
        },
        "hide_peek": {
          "animations": [
            { "hide_peek": "!q.is_baby" },
            { "baby_hide_peek": "q.is_baby" }
          ],
          "transitions": [
            {
              "default": "q.all_animations_finished || !v.hide_peek_active"
            }
          ],
          "blend_via_shortest_path": true,
          "blend_transition": 0.0
        }
      }
    }
  }
}
