{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "minecraft:cat",
      "materials": { "default": "cat", "face": "entity_alphatest" },
      "min_engine_version": "1.8.0",
      "textures": {
        "white": "textures/entity/cat/white",
        "black": "textures/entity/cat/tuxedo",
        "red": "textures/entity/cat/redtabby",
        "siamese": "textures/entity/cat/siamesecat",
        "british": "textures/entity/cat/britishshorthair",
        "calico": "textures/entity/cat/calico",
        "persian": "textures/entity/cat/persian",
        "ragdoll": "textures/entity/cat/ragdoll",
        "tabby": "textures/entity/cat/tabby",
        "jellie": "textures/entity/cat/jellie",
        "all_black": "textures/entity/cat/allblackcat",

        "white_tame": "textures/entity/cat/white_tame",
        "black_tame": "textures/entity/cat/tuxedo_tame",
        "red_tame": "textures/entity/cat/redtabby_tame",
        "siamese_tame": "textures/entity/cat/siamesecat_tame",
        "british_tame": "textures/entity/cat/britishshorthair_tame",
        "calico_tame": "textures/entity/cat/calico_tame",
        "persian_tame": "textures/entity/cat/persian_tame",
        "ragdoll_tame": "textures/entity/cat/ragdoll_tame",
        "tabby_tame": "textures/entity/cat/tabby_tame",
        "all_black_tame": "textures/entity/cat/allblackcat_tame",
        "jellie_tame": "textures/entity/cat/jellie_tame",

        "white_face": "textures/entity/cat/white_face",
        "black_face": "textures/entity/cat/tuxedo_face",
        "red_face": "textures/entity/cat/redtabby_face",
        "siamese_face": "textures/entity/cat/siamesecat_face",
        "british_face": "textures/entity/cat/britishshorthair_face",
        "calico_face": "textures/entity/cat/calico_face",
        "persian_face": "textures/entity/cat/persian_face",
        "ragdoll_face": "textures/entity/cat/ragdoll_face",
        "tabby_face": "textures/entity/cat/tabby_face",
        "all_black_face": "textures/entity/cat/allblackcat_face",
        "jellie_face": "textures/entity/cat/jellie_face"
      },
      "geometry": {
        "default": "geometry.crl.cat",
        "face": "geometry.crl.cat.face"
      },
      "animations": {
        "idle": "animation.crl.common.idle_body",
        "walk": "animation.crl.four_legs.walk",
        "look_at_target_plus_body": "animation.crl.four_legs.look_at_target",
        "vertical_adjustment": "animation.crl.common.vertical_adjustment",
        "body_scale": "animation.crl.four_legs.scale",

        "sneak": "animation.crl.cat.sneak",
        "cat_walk": "animation.crl.cat.walk",
        "cat_idle": "animation.crl.cat.idle",
        "sprint": "animation.crl.cat.sprint",
        "sit": "animation.crl.cat.sit",
        "baby_transform": "animation.crl.cat.baby_transform",
        "lie_down": "animation.crl.cat.lie_down",

        "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_move": "controller.animation.crl.cat.move",
        "control_eyes": "controller.animation.crl.eye_movement",
        "control_eyebrows": "controller.animation.crl.eyebrow_movement"
      },
      "scripts": {
        "animate": [
          "idle",
          "body_scale",
          "vertical_adjustment",
          "look_at_target_plus_body",
          "cat_walk",
          "cat_idle",
          { "baby_transform": "query.is_baby" },
          "control_move",
          "control_eyes",
          "control_eyebrows"
        ],
        "initialize": [
          "v.body_scale = 1.05;",
          "variable.eye_rot.max_diff = 30;",
          "variable.vertical_adjustment_weight = 10.0;",

          "v.distance_moved_weight = 3;",

          "variable.time_not_in_water = 0;",
          "v.previous_health = query.health;",
          "v.last_hurt_time = 1000;"
        ],
        "pre_animation": [
          "v.speed = query.modified_move_speed;",

          "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;"
        ]
      },
      "render_controllers": ["controller.render.crl.cat", "controller.render.crl.cat.face"],
      "spawn_egg": {
        "texture": "spawn_egg",
        "texture_index": 53
      }
    }
  }
}
