{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "minecraft:drowned",
      "min_engine_version": "1.16.0",
      "materials": {
        "default": "entity_emissive_alpha",
        "multi": "entity_multitexture_alpha_test",
        "masked": "villager_v2_masked"
      },
      "textures": {
        "base_body": "textures/entity/zombie/drowned/base_body",
        "base_head_0": "textures/entity/zombie/drowned/base_head_0",
        "base_head_1": "textures/entity/zombie/drowned/base_head_1",
        "base_head_2": "textures/entity/zombie/drowned/base_head_2",
        "base_face": "textures/entity/zombie/drowned/base_face",
        "base_algae": "textures/entity/zombie/drowned/base_algae",

        "pants_0": "textures/entity/zombie/pants/pants_0",
        "pants_1": "textures/entity/zombie/pants/pants_1",
        "pants_2": "textures/entity/zombie/pants/pants_2",
        "pants_3": "textures/entity/zombie/pants/pants_3",
        "pants_4": "textures/entity/zombie/pants/pants_4",
        "pants_5": "textures/entity/zombie/pants/pants_5",
        "pants_6": "textures/entity/zombie/pants/pants_6",
        "pants_7": "textures/entity/zombie/pants/pants_7",
        "pants_8": "textures/entity/zombie/pants/pants_4",
        "pants_9": "textures/entity/zombie/pants/pants_5",
        "pants_10": "textures/entity/zombie/pants/pants_6",
        "pants_11": "textures/entity/zombie/pants/pants_11",

        "top_0": "textures/entity/zombie/tops/top_0",
        "top_1": "textures/entity/zombie/tops/top_1",
        "top_2": "textures/entity/zombie/tops/top_2",
        "top_3": "textures/entity/zombie/tops/top_3",
        "top_4": "textures/entity/zombie/tops/top_4",
        "top_5": "textures/entity/zombie/tops/top_5",
        "top_6": "textures/entity/zombie/tops/top_6",
        "top_7": "textures/entity/zombie/tops/top_7",
        "top_8": "textures/entity/zombie/tops/top_8",
        "top_9": "textures/entity/zombie/tops/top_9",
        "top_10": "textures/entity/zombie/tops/top_10",
        "top_11": "textures/entity/zombie/tops/top_11",
        "top_12": "textures/entity/zombie/tops/top_12",
        "top_13": "textures/entity/zombie/tops/top_13",
        "top_14": "textures/entity/zombie/tops/top_14",
        "top_15": "textures/entity/zombie/tops/top_15",

        "mask_empty": "textures/entity/zombie/masks/mask_empty",
        "top_mask_0": "textures/entity/zombie/masks/top_mask_0",
        "pants_mask_0": "textures/entity/zombie/masks/pants_mask_0",

        "hair_empty": "textures/entity/zombie/hair/empty",
        "hair_0": "textures/entity/zombie/hair/alex_hair_head",
        "hair_1": "textures/entity/zombie/hair/ari_hair_head",
        "hair_2": "textures/entity/zombie/hair/efe_hair_head",
        "hair_3": "textures/entity/zombie/hair/kai_hair_head",
        "hair_4": "textures/entity/zombie/hair/makena_hair_head",
        "hair_5": "textures/entity/zombie/hair/noor_hair_head",
        "hair_6": "textures/entity/zombie/hair/steve_hair_head",
        "hair_7": "textures/entity/zombie/hair/sunny_hair_head",
        "hair_8": "textures/entity/zombie/hair/zuri_hair_head",

        "face_item_empty": "textures/entity/zombie/face_items/empty",
        "face_item_0": "textures/entity/zombie/face_items/face_item_0",
        "face_item_1": "textures/entity/zombie/face_items/face_item_1",
        "face_item_2": "textures/entity/zombie/face_items/face_item_2",
        "face_item_3": "textures/entity/zombie/face_items/face_item_3",
        "face_item_4": "textures/entity/zombie/face_items/face_item_4",

        "headwear_pan": "textures/entity/zombie/headwear/headwear_pan",
        "headwear_traffic_cone": "textures/entity/zombie/headwear/headwear_traffic_cone"
      },
      "geometry": {
        // The geometry with item bones needs to have the name default. Do not ask me why :(
        "default": "geometry.crl.humanoid.base",
        "head": "geometry.crl.humanoid.head",
        "face": "geometry.crl.humanoid.face",

        "headwear_pan": "geometry.crl.humanoid.head.headwear.pan",
        "headwear_traffic_cone": "geometry.crl.humanoid.head.headwear.traffic_cone"
      },
      "scripts": {
        "initialize": [
          "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;",

          "variable.random_pants = Math.random_integer(0,1000);",
          "variable.random_tops = Math.random_integer(0,1000);",
          "variable.random_hair = Math.random_integer(0,1000);",
          "variable.random_head = Math.random_integer(0,1000);",
          "variable.random_face_item = Math.random_integer(0,1000);",
          "variable.random_headwear = Math.random_integer(0,1000);",
          "variable.random_top_mask = 1;",
          "variable.random_pants_mask = 1;",

          "variable.visibility_headwear = Math.random_integer(0,10);"
        ],
        "pre_animation": [
          "variable.tcos0 = (Math.cos(query.modified_distance_moved * 38.17) * query.modified_move_speed / variable.gliding_speed_value) * 57.3;",

          "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": [
          { "humanoid_big_head": "query.is_baby" },
          "look_at_target",
          "move",
          { "riding.arms": "query.is_riding" },
          { "riding.legs": "query.is_riding" },
          "holding",
          { "charging": "query.is_charging" },
          "attack_controller",
          { "brandish_spear": "variable.is_brandishing_spear" },
          "bob",
          { "damage_nearby_mobs": "variable.damage_nearby_mobs" },
          {
            "use_item_progress": "( variable.use_item_interval_progress > 0.0 ) || ( variable.use_item_startup_progress > 0.0 )"
          },
          { "swimming": "variable.swim_amount > 0.0" },

          "zombie_vertical_adjustment",

          "control_eye_movement",
          "control_eyebrow_movement",

          "vertical_adjustment",
          "body_scale",
          "idle"
        ]
      },
      "animations": {
        "humanoid_big_head": "animation.humanoid.big_head",
        "look_at_target": "controller.animation.humanoid.look_at_target",
        "look_at_target_gliding": "animation.humanoid.look_at_target.gliding",
        "look_at_target_swimming": "animation.humanoid.look_at_target.swimming",
        "riding.arms": "animation.humanoid.riding.arms",
        "riding.legs": "animation.humanoid.riding.legs",
        "holding": "animation.humanoid.holding",
        "brandish_spear": "animation.humanoid.brandish_spear",
        "charging": "animation.humanoid.charging",
        "bob": "animation.humanoid.bob",
        "damage_nearby_mobs": "animation.humanoid.damage_nearby_mobs",
        "use_item_progress": "animation.humanoid.use_item_progress",
        "attack_controller": "controller.animation.drowned.attack.rotations",
        "zombie_attack_bare_hand": "animation.zombie.attack_bare_hand",
        "attack_rotations": "animation.drowned.attack.rotations",

        "zombie_vertical_adjustment": "animation.crl.zombie.vertical_adjustment",
        "control_eye_movement": "controller.animation.crl.eye_movement",
        "control_eyebrow_movement": "controller.animation.crl.eyebrow_movement",

        "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",

        "move": "animation.crl.two_legs.walk_with_arms",
        "look_at_target_default": "animation.crl.two_legs.look_at_target",
        "swimming": "animation.crl.zombie.swimming",

        "vertical_adjustment": "animation.crl.two_legs.vertical_adjustment",
        "body_scale": "animation.crl.two_legs.scale",
        "idle": "animation.crl.two_legs.idle"
      },
      "render_controllers": [
        "controller.render.crl.drowned.algae",
        "controller.render.crl.humanoid.base.tops",
        "controller.render.crl.humanoid.base.pants",
        "controller.render.crl.humanoid.base",
        "controller.render.crl.humanoid.head.overlay",
        "controller.render.crl.humanoid.head.base",
        "controller.render.crl.humanoid.head.face",
        "controller.render.crl.humanoid.head.headwear"
      ],
      "enable_attachables": true,
      "spawn_egg": {
        "texture": "spawn_egg",
        "texture_index": 48
      }
    }
  }
}
