{
  "format_version": "1.19.0",
  "minecraft:attachable": {
    "description": {
      "identifier": "tsu_morph:armadillo_morph",
      "materials": {
        "default": "entity_alphatest"
      },
      "textures": {
        "default": "textures/entity/armadillo"
      },
      "geometry": {
        "default": "geometry.tsu_morph.armadillo"
      },
      "animations": {
        "look_at_target": "animation.tsu_morph.armadillo.look_at_target",
        "look_at_target_controller": "controller.animation.armadillo.look_at_target",
        "walk": "animation.tsu_morph.armadillo.walk",
        "roll_up": "animation.tsu_morph.armadillo.roll_up",
        "rolled_up": "animation.tsu_morph.armadillo.rolled_up",
        "peek": "animation.tsu_morph.armadillo.peek",
        "unroll": "animation.tsu_morph.armadillo.unroll",
        "unroll_fast": "animation.tsu_morph.armadillo.unroll_fast",
        "roll_up_controller": "controller.animation.armadillo.roll_up",

        "hurt_sounds": "controller.animation.tsu_morph.armadillo.hurt_sounds",
        "step_sounds": "controller.animation.tsu_morph.step_sounds",
        "idle_sounds": "animation.tsu_morph.idle_sounds"
      },
      "sound_effects": {
        "roll": "mob.armadillo.roll",
        "land": "mob.armadillo.land",
        "peek": "mob.armadillo.peek",
        "unroll_start": "mob.armadillo.unroll_start",
        "unroll_finish": "mob.armadillo.unroll_finish",
        "step": "mob.armadillo.step",
        "hurt": "mob.armadillo.hurt",
        "hurt_reduced": "mob.armadillo.hurt_reduced",
        "idle": "mob.armadillo.ambient"
      },
      "scripts": {
        "initialize": [
          "v.current_health = q.health;",
          "v.step_interval = 0.24;"
        ],
        "pre_animation": [
          "variable.x_head_rotation = math.clamp(query.target_x_rotation, -32.5, 32.5);",
          "variable.y_head_rotation = math.clamp(query.target_y_rotation, -22.5, 25);",
          "v.is_rolled_up = q.is_sneaking;",
          "variable.rolled_up_time = q.is_sneaking ? ((variable.rolled_up_time ?? 0.0) + query.delta_time) : 0.0;",
          "variable.is_unrolling = variable.rolled_up_time > 0 && !q.is_sneaking;",
          "variable.is_peeking = q.is_sneaking && q.is_moving;",
          "variable.unrolling_time = variable.is_unrolling ? ((variable.unrolling_time ?? 0.0) + query.delta_time) : 0.0;",
          "variable.use_rolled_up_model = variable.rolled_up_time >= 0.2083 && (variable.unrolling_time == 0.0 || variable.unrolling_time <= 1.25 );",
          "variable.walking = query.modified_move_speed > 0.01 && !q.is_sneaking;",
          "variable.walk_anim_time_update = query.anim_time + math.min(3.0, math.lerp(2.0, 5.0, query.modified_move_speed)) * query.delta_time;",
          "v.display_fp = c.is_first_person && !q.is_in_ui && q.is_local_player;"
        ],
        "animate": [
          "look_at_target_controller",
          {
            "walk": "q.modified_move_speed"
          },
          "roll_up_controller",
          "hurt_sounds",
          "step_sounds",
          "idle_sounds"
        ]
      },
      "render_controllers": [
        {
          "controller.render.tsu_morph.armadillo": "!v.display_fp"
        }
      ]
    }
  }
}