{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "minecraft:creeper",
      "min_engine_version": "1.8.0",
      "materials": {
        "default": "entity_alphatest",
        "charged": "charged_creeper"
      },
      "textures": {
        "default": "textures/entity/creeper/default",
        "default_face": "textures/entity/creeper/default_face",
        
        "blue": "textures/entity/creeper/blue",
        "blue_face": "textures/entity/creeper/blue_face",

        "light_blue": "textures/entity/creeper/light_blue",
        "light_blue_face": "textures/entity/creeper/light_blue_face",

        "purple": "textures/entity/creeper/purple",
        "purple_face": "textures/entity/creeper/purple_face",

        "red": "textures/entity/creeper/red",
        "red_face": "textures/entity/creeper/red_face",

        "yellow": "textures/entity/creeper/yellow",
        "yellow_face": "textures/entity/creeper/yellow_face",

        "charged": "textures/entity/creeper/creeper_armor"
      },
      "geometry": {
        "default": "geometry.crl.creeper",
        "default_face": "geometry.crl.creeper.face",
        "charged": "geometry.crl.creeper.armor"
      },
      "spawn_egg": {
        "texture": "spawn_egg",
        "texture_index": 6
      },
      "scripts": {
        "initialize": [
          "variable.random_variant = Math.random_integer(0,100);",

          "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.wobble = Math.sin(query.swell_amount * 5730) * query.swell_amount * 0.01 + 1.0;",
          "variable.swelling_scale1 = (Math.pow(Math.clamp(query.swell_amount, 0.0, 1.0), 4.0) * 0.4 + 1.0) * variable.wobble;",
          "variable.swelling_scale2 = (Math.pow(Math.clamp(query.swell_amount, 0.0, 1.0), 4.0) * 0.1 + 1.0) / variable.wobble;",
          "variable.leg_rot = Math.cos(query.modified_distance_moved * 38.17326) * 80.22 * query.modified_move_speed;",
          "variable.flash = Math.mod(Math.Round(query.swell_amount * 10.0), 2.0);",
          
          "variable.tilt_rotation = math.clamp(math.abs(query.ground_speed), 0, 10)/10* 45;",

          "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": [
          "creeper_swelling",
          "creeper_tilt",
          
          "idle",
          "walk",
          "look_at_target",
          "scale",
          "vertical_adjustment",

          "eye_movement",
          "eyebrow_movement"
        ]
      },
      "animations": {
        "creeper_swelling": "animation.crl.creeper.swelling",
        "creeper_tilt": "animation.crl.creeper.tilt",

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

        "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.creeper.armor",
      "controller.render.crl.creeper",
      "controller.render.crl.creeper.face"
       ]
    }
  }
}