{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "minecraft:zombie_horse",
      "min_engine_version": "1.2.6",
      "materials": {
        "default": "horse",
        "addons": "entity_alphatest",
        "face": "entity_alphatest"
      },
      "textures": {
        "default": "textures/entity/horse2/horse_zombie",
        "default_face": "textures/entity/horse2/horse_zombie_face",
        "markings_none": "textures/entity/horse2/horse_markings_none",
        "armor_none": "textures/entity/horse2/armor/horse_armor_none",

        "addons": "textures/entity/horse2/horse_addons"
      },
      "geometry": {
        "default": "geometry.crl.horse.v3",
        "addons": "geometry.crl.horse.v3.addons",
        "face": "geometry.crl.horse.v3.face"
      },
      "animations": {
        "baby_transform": "animation.crl.horse.v3.baby_transform",
        "walk": "animation.crl.horse.v3.walk",
        "eat": "animation.crl.horse.v3.eat",
        "rear": "animation.crl.horse.v3.rear",
        "tail": "animation.crl.horse.v3.tail",
        "look_at_player": "animation.crl.horse.v3.look_at_player",

        "idle": "animation.crl.common.idle_body",
        "vertical_adjustment": "animation.crl.common.vertical_adjustment",
        "body_scale": "animation.crl.four_legs.scale",
        "walk_addition": "animation.crl.horse.v3.walk_addition",
        "walk_moving_parts": "animation.crl.horse.v3.walk_moving_parts",

        "control_vertical_adjustment": "controller.animation.crl.horse.v3.vertical_adjustment",

        "blink": "animation.crl.face.blink",
        "blink_long": "animation.crl.face.blink_long",
        "move_eyes": "animation.crl.face.sideways.move_eyes",
        "move_eyebrows": "animation.crl.face.move_eyebrows",
        "scared_eyebrows": "animation.crl.face.sideways.scared_eyebrows",
        "sleep_eyes": "animation.crl.face.sleep_eyes",
        "angry_eyebrows": "animation.crl.face.sideways.angry_eyebrows",

        "control_eye_movement": "controller.animation.crl.eye_movement",
        "control_eyebrow_movement": "controller.animation.crl.eyebrow_movement"
      },
      "scripts": {
        "initialize": [
          "variable.eat_anim = 0.0;",
          "v.time_in_air = 0;",
          "v.time_not_in_air = 0;",

          "v.body_scale = 1.05;",
          "variable.eye_rot.max_diff = 45;",
          "variable.vertical_adjustment_weight = 3.0;",

          "v.distance_moved_weight = 1;",
          "v.modified_move_speed_weight = 1;",

          "variable.time_not_in_water = 0;",
          "v.previous_health = query.health;",
          "v.last_hurt_time = 1000;"
        ],
        "pre_animation": [
          "variable.armor_texture_slot = query.armor_texture_slot(1);",
          "variable.eat_anim = math.clamp(variable.eat_anim + (query.is_grazing ? ((1.0 - variable.eat_anim) * 0.4 + 0.05) : -variable.eat_anim * 0.4 - 0.05) * query.delta_time * 20.0, 0.0, 1.0);",
          "variable.head_x_rot = query.target_x_rotation + (query.modified_move_speed > 0.2 ? (math.cos(query.modified_distance_moved * 11.46) * 11.46 * query.modified_move_speed + query.modified_move_speed * 11.46) : 0.0);",
          "variable.inverse_max_stand_eat = (1.0 - math.max(variable.stand_anim, variable.eat_anim));",
          "variable.leg_stand_factor = math.cos((query.modified_distance_moved * 33.38) + 180.0);",
          "variable.leg_x_rot_anim = variable.leg_stand_factor * 45.8 * query.modified_move_speed;",

          "variable.time_in_air = (query.is_on_ground ? 0 : (variable.time_in_air + query.delta_time));",
          "variable.time_in_air = math.clamp(variable.time_in_air, 0, 100);",

          "variable.eye_rot.x = (query.target_x_rotation - this);",
          "variable.eye_rot.y = (query.target_y_rotation - this);",
          "variable.eye_rot_clamp.x = math.clamp(variable.eye_rot.x, -variable.eye_rot.max_diff, variable.eye_rot.max_diff);",
          "variable.eye_rot_clamp.y = math.clamp(variable.eye_rot.y, -variable.eye_rot.max_diff, variable.eye_rot.max_diff);",

          "variable.eye_ratio.x = (variable.eye_rot_clamp.x / variable.eye_rot.max_diff);",
          "variable.eye_ratio.y = (variable.eye_rot_clamp.y / variable.eye_rot.max_diff);",

          "variable.time_not_in_water = (query.is_in_water ? 0 : (variable.time_not_in_water + query.delta_time));",
          "variable.time_not_in_water = math.clamp(variable.time_not_in_water, 0, 100);",

          "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;"
        ],
        "animate": [
          "idle",
          "body_scale",
          "walk_addition",
          "walk_moving_parts",
          "control_vertical_adjustment",

          { "baby_transform": "query.is_baby" },
          "walk",
          "look_at_player",
          { "rear": "variable.stand_anim > 0.0" },
          { "eat": "!query.is_standing" },
          { "tail": "variable.shake_tail" },

          "control_eye_movement",
          "control_eyebrow_movement"
        ]
      },
      "render_controllers": [
        "controller.render.crl.skeleton_and_zombie_horse.v3",
        "controller.render.crl.horse.v3.addons",
        "controller.render.crl.skeleton_and_zombie_horse.v3.face"
      ],
      "spawn_egg": {
        "texture": "spawn_egg",
        "texture_index": 33
      }
    }
  }
}
