{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "minecraft:parrot",
      "materials": { "default": "parrot" },
      "textures": {
        "blue": "textures/entity/parrot/parrot_blue",
        "green": "textures/entity/parrot/parrot_green",
        "red_blue": "textures/entity/parrot/parrot_red_blue",
        "yellow_blue": "textures/entity/parrot/parrot_yellow_blue",
        "grey": "textures/entity/parrot/parrot_grey"
      },
      "geometry": {
        "default": "geometry.crl.parrot"
      },
      "scripts": {
        "initialize": ["v.vertical_adjustment_weight = 10;"],
        "pre_animation": [
          "variable.state = query.is_dancing ? 3 : (query.is_sitting ? 2 : (!query.is_on_ground && !query.is_jumping && !query.is_riding ? 0 : 1));",
          "variable.dance.x = Math.cos(query.life_time * 57.3 * 20.0);",
          "variable.dance.y = -Math.sin(query.life_time * 57.3 * 20.0);",
          "variable.wing_flap = ((math.sin(query.wing_flap_position * 57.3) + 1) * query.wing_flap_speed);",

          "variable.fly_speed=(math.clamp(query.ground_speed, 0, 4) / 4);",

          "variable.vertical_speed = q.vertical_speed;",
          "variable.scaled_vertical_speed = math.abs(variable.vertical_speed) * math.clamp(variable.vertical_speed, -1, 1);",
          "variable.clamped_vertical_speed = math.clamp(variable.scaled_vertical_speed * -3, -90, 90);"
        ],
        "animate": [
          "control_movement",
          "look_at_target",
          "vertical_adjustment",
          "idle"
        ]
      },
      "animations": {
        "dance": "animation.crl.parrot.dance",
        "sitting": "animation.crl.parrot.sitting",
        "flying": "animation.crl.parrot.flying",
        "standing": "animation.crl.parrot.standing",
        "idle": "animation.crl.parrot.idle",
        "fly_adjustment": "animation.crl.parrot.fly_adjustment",
        "look_at_target": "animation.crl.common.look_at_target",

        "vertical_adjustment": "animation.crl.parrot.vertical_adjustment",

        "control_movement": "controller.animation.crl.parrot.move"
      },
      "render_controllers": ["controller.render.crl.parrot"],
      "spawn_egg": {
        "texture": "spawn_egg",
        "texture_index": 43
      }
    }
  }
}
