{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "minecraft:cod",
      "materials": { "default": "cod" },
      "textures": {
        "atlantic_cod": "textures/entity/fish/cod/atlantic_cod",
        "atlantic_cod_black_top": "textures/entity/fish/cod/atlantic_cod_black_top",
        "atlantic_cod_golden": "textures/entity/fish/cod/atlantic_cod_golden",
        "black_cod": "textures/entity/fish/cod/black_cod",
        "red_cod": "textures/entity/fish/cod/red_cod"
      },
      "geometry": {
        "default": "geometry.crl.cod"
      },
      "scripts": {
        "initialize": [
          "variable.random_variant = Math.random_integer(0,1000);"
        ],
        "pre_animation": [
          "variable.ZRot = !query.is_in_water ? Math.cos((query.time_stamp + query.frame_alpha) * 14.32) * 90 : 0.0;",
          "variable.AnimationAmountBlend = Math.lerp(variable.AnimationAmountPrev, variable.AnimationAmount, query.frame_alpha);",

          "variable.vertical_speed = q.vertical_speed;",
          "variable.scaled_speed = math.ln(math.abs(variable.vertical_speed * 3) + 1) * math.clamp(variable.vertical_speed, -1, 1);",
          "variable.clamped_speed = math.clamp(variable.scaled_speed * -20, -90, 90);"
        ],
        "animate": ["control_general", "control_always"]
      },
      "animations": {
        "flop": "animation.crl.cod.flop",
        "swim": "animation.crl.cod.swim",
        "idle": "animation.crl.cod.idle",

        "fish_idle": "animation.crl.fish.idle",
        "fish_vert": "animation.crl.fish.vertical_adjustment",
        "control_general": "controller.animation.crl.fish.general",
        "control_always": "controller.animation.crl.fish.always"
      },
      "render_controllers": ["controller.render.crl.cod"],
      "spawn_egg": {
        "texture": "spawn_egg",
        "texture_index": 45
      }
    }
  }
}
