{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "minecraft:chicken",
      "min_engine_version": "1.12.0",
      "materials": {
        "default": "chicken",
        "legs": "entity_alphatest",
        "comb": "entity_alphatest"
      },
      "textures": {
        "default": "textures/entity/chicken",
        "default_0": "textures/entity/chicken_0",
        "default_1": "textures/entity/chicken_1",
        "default_2": "textures/entity/chicken_2",
        "default_3": "textures/entity/chicken_3",
        "default_4": "textures/entity/chicken_4",
        "default_5": "textures/entity/chicken_5"
      },
      "geometry": {
        "default": "geometry.crl.chicken"
      },
      "animations": {
        "idle": "animation.crl.common.idle_body",
        "fly": "animation.crl.chicken.fly",
        "vertical_adjustment": "animation.crl.common.vertical_adjustment",
        "move": "animation.crl.chicken.walk",
        "general": "animation.crl.chicken.general",
        "look_at_target": "animation.crl.common.look_at_target",
        "baby_transform": "animation.crl.chicken.baby_transform"
      },
      "scripts": {
        "animate": [
          "idle",
          "general",
          "move",
          "vertical_adjustment",
          "fly",
          "look_at_target",
          { "baby_transform": "query.is_baby" }
        ],
        "initialize": [
          "variable.random_variant = Math.random_integer(0,12);",
          "v.vertical_adjustment_weight = 10;",

          "v.previous_health = query.health;",
          "v.last_hurt_time = 1000;"
        ],
        "pre_animation": [
          "v.last_hurt_time = (query.health < v.previous_health ? 0 :  Math.clamp(v.last_hurt_time + query.delta_time, 0,1000) );",

          "v.previous_health=query.health;"
        ]
      },
      "render_controllers": ["controller.render.crl.chicken"],
      "spawn_egg": {
        "texture": "spawn_egg",
        "texture_index": 0
      }
    }
  }
}
