{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "cyn_hao:seahorse_big",
      "materials": {
        "alphatest": "entity_alphatest",
        "alphablend": "entity_alphablend",
        "armor": "entity_alphatest_change_color"
      },

      "render_controllers": [
        // seahorses cannot be carpetted
        "controller.render.cyn_hao.horse_armor",
        "controller.render.cyn_hao.seahorse_big"
      ],

      "textures": {
        // none texture
        "none": "textures/entity/horse2/armor/horse_armor_none",

        // base coat colors
        "base_orange": "textures/cynosia/horses/entity/sea_big/base_orange",
        "light_blue": "textures/cynosia/horses/entity/sea_big/base_Lblue",
        "base_yellow": "textures/cynosia/horses/entity/sea_big/base_yellow",
        "base_lime": "textures/cynosia/horses/entity/sea_big/base_lime",
        "base_pink": "textures/cynosia/horses/entity/sea_big/base_pink",
        "base_cyan": "textures/cynosia/horses/entity/sea_big/base_cyan",
        "base_purple": "textures/cynosia/horses/entity/sea_big/base_purple",
        "base_blue": "textures/cynosia/horses/entity/sea_big/base_blue",
        "base_green": "textures/cynosia/horses/entity/sea_big/base_green",
        "base_red": "textures/cynosia/horses/entity/sea_big/base_red",

        // armor textures
        "armor_none": "textures/entity/horse2/armor/horse_armor_none",
        "armor_leather": "textures/cynosia/horses/entity/equipment/armor_leather",
        "armor_iron": "textures/cynosia/horses/entity/equipment/armor_iron",
        "armor_gold": "textures/cynosia/horses/entity/equipment/armor_gold",
        "armor_diamond": "textures/cynosia/horses/entity/equipment/armor_diamond"

      },

      "geometry": {
        "default": "geometry.cyn_hao.seahorse_big"
      },

      "sound_effects": {
        "flop": "mob.seahorse_big.flop"
      },

      "animations": {
        "look_at_target": "animation.cyn_horse.look_at_target",
        "random_scale": "animation.cyn_horse.random_scale",
        "baby_transform": "animation.cyn_horse.baby_transform",

        "idle_water": "animation.cyn_seahorse_big.idle_water",
        "idle_land": "animation.cyn_seahorse_big.idle_land",

        "move_water": "animation.cyn_seahorse_big.move_water",
        "move_land": "animation.cyn_seahorse_big.move_land",

        "sit_land": "animation.cyn_seahorse_big.sit_land",

        "movement_controller": "controller.animation.cyn_hao.horse.movement_swimmer"
      },
      
      "scripts": {
        "initialize": [
          "variable.idle_roll = 0;",
          "variable.babyGroundOffset = 3.0;",
          "variable.babyHeadSize = 1.2;",
          "variable.babyLegWidth = 1.28;",
          "variable.babyLegHeight = 0.9;"
          // height and density moved to behavior pack,
          // as these values change on world load
          // since the entities are being re-initialized
        ],
        "pre_animation": [
          // this whole mess of a variable is taken from vanilla horse, so we can use the same "look at target" logic vanilla horses use
          "variable.head_x_rot = query.target_x_rotation + (query.modified_move_speed > 0.2 ? (math.cos(query.modified_distance_moved * 11.46) * 11.46 * query.modified_move_speed + query.modified_move_speed * 11.46) : 0.0);",
          
          // easing formulas since I couldn't get math.lerp to work
          // multiplied by 16 since query.model_scale returns scale * 16...? I guess?
          // used in baby_transform animations, but defined as variables here
          // since we use these specific values 12 times
          // no need to run the query and do the math 12 times each frame!

          // -------------------------
          // -------------------------
          // -------------------------
          // MAKE SURE YOU UPDATE THE FORMULAS IF YOU CHANGE ANY VALUES!!!
          // -------------------------
          // -------------------------
          // -------------------------

          // formula to ease from 1.2 to 1.0, based on a scale from 0.5 to 1.0
          // y = 0.6x + 6
          // x: 0.5 -> y: 1.2
          // x: 1.0 -> y: 1.0
          "variable.babyHeadSize = ((-0.4 * (query.model_scale * 16.0)) + 1.4);",

          // formula to ease from 3.0 to 0.0, based on a scale from 0.5 to 1.0
          // y = 0.6x + 6
          // x: 0.5 -> y: 3.0
          // x: 1.0 -> y: 0.0
          "variable.babyGroundOffset = ((-6.0 * (query.model_scale * 16.0)) + 6.0);",
          
          // formula to ease from 0.9 to 1.0, based on a scale from 0.5 to 1.0
          // y = 0.2x + 0.8
          // x: 0.5 -> y: 0.9
          // x: 1.0 -> y: 1.0
          "variable.babyLegWidth = ((0.2 * (query.model_scale * 16.0)) + 0.8);",

          // formula to ease from 1.28 to 1.0, based on a scale from 0.5 to 1.0
          // y = -0.56x + 1.56
          // x: 0.5 -> y: 1.28
          // x: 1.0 -> y: 1.0
          "variable.babyLegHeight = ((-0.56 * (query.model_scale * 16.0)) + 1.56);"

        ],
        "animate": [
          "random_scale",
          { "baby_transform": "query.is_baby" },
          "movement_controller"
        ]
      },
     
      "spawn_egg": {
        "texture": "cyn_hao.seahorse_big_egg"
      }
    }
  }
}