// @buildsys GENERATED MERGED FILE: DO NOT EDIT DIRECTLY! 
{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "mnp_ci:animal_jellyfish",
      "materials": {
        "default": "entity_alphatest",
        "alpha_one_sided": "entity_alphatest_one_sided"
      },
      "textures": {
        "default": "textures/mnp/ci/entity/animal_jellyfish_1",
        "pearl": "textures/mnp/ci/entity/animal_jellyfish_2",
        "brown": "textures/mnp/ci/entity/animal_jellyfish_3",
        "indigo": "textures/mnp/ci/entity/animal_jellyfish_4"
      },
      "geometry": {
        "default": "geometry.mnp_ci.animal_jellyfish"
      },
      "scripts": {
        "initialize": [
          "v.prev_time_stamp = q.time_stamp;",
          "v.velocityX = 0;",
          "v.velocityZ = 0;",
          "v.prevPosX = q.position(0);",
          "v.prevPosZ = q.position(2);",
          "v.magn = 0;",
          "v.yaw = 0;",
          "v.smooth_horizontal_velocity = 0;",
          "v.local_spin = math.random(0,360);",
          "v.spin_coeff = 0;"
        ],
        "pre_animation": [
          "q.time_stamp > v.prev_time_stamp ? {v.velocityX = q.position(0) - v.prevPosX; v.prevPosX = q.position(0); v.velocityZ = q.position(2) - v.prevPosZ; v.prevPosZ = q.position(2); v.magn = math.sqrt(math.pow(v.velocityX,2) + math.pow(v.velocityZ,2));};",
          "v.magn > 0.0001 ? {v.yaw = math.lerprotate(math.atan2(v.velocityZ, v.velocityX), v.yaw, math.exp(-1 * q.delta_time));};",
          "v.smooth_horizontal_velocity = math.lerp(math.clamp((math.abs(v.velocityX) + math.abs(v.velocityZ)) * 20, 0, 1), v.smooth_horizontal_velocity, math.exp(-1 * q.delta_time));",
          "v.spin_coeff = v.spin_coeff - q.delta_time * 0.2;",
          "v.local_spin = v.local_spin + q.delta_time * -12 * (1 - v.smooth_horizontal_velocity * 0.8) * (1-math.cos(math.clamp(v.spin_coeff, 0, 1)*180)) * q.is_in_water;",
          "v.prev_time_stamp = q.time_stamp;",
          "v.is_on_lure = q.property('mnp_ci:is_on_lure');",
          "v.is_caught = q.property('mnp_ci:is_caught');"
        ],
        "animate": [
          {
            "swim": "q.is_in_water"
          },
          {
            "swim2": "q.is_in_water"
          },
          {
            "swim.angle": "q.is_in_water"
          },
          {
            "stranded": "!q.is_in_water"
          }
        ]
      },
      "animations": {
        "swim": "animation.mnp_ci.jellyfish.swim",
        "swim2": "animation.mnp_ci.jellyfish.swim2",
        "swim.angle": "animation.mnp_ci.jellyfish.swim.angle",
        "stranded": "animation.mnp_ci.jellyfish.stranded"
      },
      "render_controllers": [
        "controller.render.mnp_ci.jellyfish"
      ],
      "spawn_egg": {
        "texture": "mnp_ci:spawn_egg_animal_jellyfish"
      }
    }
  }
}