{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "minecraft:wolf",
      "materials": {
        "default": "entity_alphatest",
        "collar": "entity_alphatest_change_color"
      },
      "textures": {
        "c_black": "textures/entity/wolf/custom/wolf_black",
        "c_brown": "textures/entity/wolf/custom/wolf_brown",
        "c_white": "textures/entity/wolf/custom/wolf_white",
        "c_silver": "textures/entity/wolf/custom/wolf_silver",
        "c_gray": "textures/entity/wolf/custom/wolf_gray",

        "default": "textures/entity/wolf/wolf",
        "pale": "textures/entity/wolf/wolf",
        "ashen": "textures/entity/wolf/wolf_ashen",
        "black": "textures/entity/wolf/wolf_black",
        "chestnut": "textures/entity/wolf/wolf_chestnut",
        "rusty": "textures/entity/wolf/wolf_rusty",
        "snowy": "textures/entity/wolf/wolf_snowy",
        "spotted": "textures/entity/wolf/wolf_spotted",
        "striped": "textures/entity/wolf/wolf_striped",
        "woods": "textures/entity/wolf/wolf_woods",

        "collar": "textures/entity/wolf/collar"
      },
      "geometry": {
        "default": "geometry.crl.wolf",
        "collar": "geometry.crl.wolf.collar"
      },
      "scripts": {
        "initialize": [
          "variable.random_variant = Math.random_integer(0,1);",

          "variable.eye_rot.max_diff = 55;",

          "variable.time_not_in_water = 0;",
          "v.previous_health = query.health;",
          "v.last_hurt_time = 1000;",

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

          "variable.vertical_adjustment_weight = 7.0;"
        ],
        "pre_animation": [
          "variable.body_shake_angle = 0.05 * query.frame_alpha + query.shake_angle;",
          "variable.body_roll_progress = Math.clamp((variable.body_shake_angle - 0.16) / 1.8, 0, 1);",
          "variable.body_rot_z = Math.sin(variable.body_roll_progress * 180) * Math.sin(variable.body_roll_progress * 1980) * 27;",
          "variable.upper_body_roll_progress = Math.clamp((variable.body_shake_angle - 0.08) / 1.8, 0, 1);",
          "variable.upper_body_rot_z = (Math.sin(variable.upper_body_roll_progress * 180) * Math.sin(variable.upper_body_roll_progress * 1980) * 27) - variable.body_rot_z;",
          "variable.tail_roll_progress = Math.clamp((variable.body_shake_angle - 0.2) / 1.8, 0, 1);",
          "variable.tail_rot_z = (Math.sin(variable.tail_roll_progress * 180) * Math.sin(variable.tail_roll_progress * 1980) * 27) - variable.body_rot_z;",
          "variable.head_roll_progress = Math.clamp(variable.body_shake_angle / 1.8, 0, 1);",
          "variable.head_rot_z = (Math.sin(variable.head_roll_progress * 180) * Math.sin(variable.head_roll_progress * 1980) * 27) - variable.body_rot_z;",

          "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": [
          "look_at_target",
          { "wolf_shaking": "query.is_shaking_wetness" },
          {
            "wolf_head_rot_z": "query.is_interested || query.is_shaking_wetness"
          },
          { "wolf_baby_scaling": "query.is_baby" },
          "wolf_tail_default",
          { "wolf_angry": "query.is_angry" },
          "wolf_sitting_control",
          "wolf_idle",
          "scale",
          "idle",
          "vertical_adjustment",
          "wolf_walk",
          "eye_movement",
          "eyebrow_movement"
        ]
      },
      "animations": {
        "wolf_baby_scaling": "animation.crl.wolf.baby_scaling",
        "wolf_head_rot_z": "animation.crl.wolf.head_rot_z",
        "wolf_tail_default": "animation.crl.wolf.tail_default",
        "wolf_angry": "animation.wolf.angry",
        "wolf_sitting": "animation.crl.wolf.sitting",
        "wolf_shaking": "animation.crl.wolf.shaking",
        "wolf_walk": "animation.crl.wolf.walk",

        "idle": "animation.crl.common.idle_body",
        "walk": "animation.crl.four_legs.walk",
        "look_at_target": "animation.crl.four_legs.look_at_target",
        "scale": "animation.crl.four_legs.scale",
        "vertical_adjustment": "animation.crl.four_legs.vertical_adjustment",

        "wolf_idle": "animation.crl.wolf.idle",

        "wolf_sitting_control": "controller.animation.wolf.sitting",
        "blink": "animation.crl.face.blink",
        "blink_long": "animation.crl.face.blink_long",
        "eye_movement": "controller.animation.crl.eye_movement",
        "eyebrow_movement": "controller.animation.crl.eyebrow_movement",
        "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"
      },
      "render_controllers": ["controller.render.crl.wolf", "controller.render.crl.wolf.collar"],
      "spawn_egg": {
        "texture": "spawn_egg",
        "texture_index": 4
      }
    }
  }
}
