{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "minecraft:vindicator",
      "min_engine_version": "1.8.0",
      "materials": { "default": "vindicator" },
      "geometry": {
        "default": "geometry.crl.illager",
        "face": "geometry.crl.illager.face"
      },
      "textures": {
        "male": "textures/entity/vindicator/vindicator",
        "male_face": "textures/entity/vindicator/vindicator_face",

        "female": "textures/entity/vindicator/vindicator_f",
        "female_face": "textures/entity/vindicator/vindicator_f_face",

        "hair_long_white": "textures/entity/villager2/hair/long_white",
        "hair_long_blonde": "textures/entity/villager2/hair/long_blonde",
        "hair_long_black": "textures/entity/villager2/hair/long_black",
        "hair_long_brown": "textures/entity/villager2/hair/long_brown",

        "hair_white": "textures/entity/villager2/hair/white",
        "hair_brown": "textures/entity/villager2/hair/brown",
        "hair_brown2": "textures/entity/villager2/hair/brown_2",
        "hair_black": "textures/entity/villager2/hair/black",
        "hair_black2": "textures/entity/villager2/hair/black_2",
        "hair_blonde": "textures/entity/villager2/hair/blonde",
        "hair_blonde2": "textures/entity/villager2/hair/blonde_2",
        "hair_blonde_bald": "textures/entity/villager2/hair/blonde_bald"
      },

      "spawn_egg": {
        "texture": "spawn_egg",
        "texture_index": 39
      },
      "scripts": {
        "scale": "0.9375",
        "initialize": [
          "variable.random_hair = Math.random_integer(0,50);",
          "variable.random_base = Math.random_integer(0,3);",
          "v.is_male = (v.random_base <= 0);",

          "v.body_scale = 1.05;",
          "variable.eye_rot.max_diff = 30;",
          "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.body_rot.x = query.body_x_rotation;",
          "variable.body_rot.y = query.body_y_rotation;",

          "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": [
          "vindicator_base",
          "vindicator_walk",

          "vertical_adjustment",
          "body_scale",

          "idle",

          "controller_look_at_target",
          "controller_vindicator_base",
          "controller_riding",

          "control_eye_movement",
          "control_eyebrow_movement"
        ]
      },
      "animations": {
        "look_at_target_gliding": "animation.humanoid.look_at_target.gliding",
        "look_at_target_swimming": "animation.humanoid.look_at_target.swimming",
        "celebrating": "animation.humanoid.celebrating",
        "controller_riding": "controller.animation.humanoid.riding",
        "controller_look_at_target": "controller.animation.humanoid.look_at_target",

        "riding.arms": "animation.crl.vindicator.riding.arms",
        "riding.legs": "animation.crl.vindicator.riding.legs",
        "vindicator_base": "animation.crl.vindicator.base",
        "vindicator_attack": "animation.crl.vindicator.attack",
        "vindicator_hand_attack": "animation.crl.vindicator.hand_attack",

        "controller_vindicator_base": "controller.animation.vindicator.base",

        "vindicator_walk": "animation.crl.two_legs.walk",
        "look_at_target_default": "animation.crl.two_legs.look_at_target",
        "vertical_adjustment": "animation.crl.two_legs.vertical_adjustment",
        "body_scale": "animation.crl.two_legs.scale",

        "idle": "animation.crl.two_legs.idle",

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

        "control_eye_movement": "controller.animation.crl.eye_movement",
        "control_eyebrow_movement": "controller.animation.crl.eyebrow_movement"
      },
      "render_controllers": [
        "controller.render.crl.vindicator.hair",
        "controller.render.crl.vindicator",
        "controller.render.crl.vindicator.face"
      ],
      "enable_attachables": true
    }
  }
}
