// @buildsys GENERATED MERGED FILE: DO NOT EDIT DIRECTLY! 
{
  "format_version": "1.20.70",
  "minecraft:client_entity": {
    "description": {
      "identifier": "mnp_ci:animal_octopus",
      "materials": {
        "default": "entity",
        "atlas": "mnp_ci_entity_uv_anim",
        "overlay": "iron_golem"
      },
      "textures": {
        "default": "textures/mnp/ci/entity/animal_octopus",
        "overlay": "textures/mnp/ci/entity/animal_octopus_overlay"
      },
      "geometry": {
        "default": "geometry.mnp_ci.animal_octopus",
        "atlas": "geometry.mnp_ci.animal_octopus_atlas"
      },
      "scripts": {
        "initialize": [
          "v.prev_time_stamp = q.time_stamp;",
          "v.velocityX = 0;",
          "v.velocityY = 0;",
          "v.velocityZ = 0;",
          "v.prevPosX = q.position(0);",
          "v.prevPosY = q.position(1);",
          "v.prevPosZ = q.position(2);",
          "v.magn = 0;",
          "v.camouflaged = q.property('mnp_ci:octopus_state') == 'camouflaged' && q.is_in_water && q.surface_particle_color.a > 0;",
          "v.yaw = q.body_y_rotation;",
          "v.pitch = 0;",
          "v.roll = 0;",
          "v.head1_rot = 0;",
          "v.is_swimming = 0;",
          "v.tentacle_rot = -25;",
          "v.tentacletip_rot = -1.17;",
          "v.texture_coord = q.surface_particle_texture_coordinate;",
          "v.texture_size = q.surface_particle_texture_size;"
        ],
        "pre_animation": [
          "q.time_stamp > v.prev_time_stamp ? {v.velocityX = q.position(0) - v.prevPosX; v.prevPosX = q.position(0); v.velocityY = q.position(1) - v.prevPosY; v.prevPosY = q.position(1); v.velocityZ = q.position(2) - v.prevPosZ; v.prevPosZ = q.position(2); v.magn = math.sqrt(math.pow(v.velocityX,2) + math.pow(v.velocityY,2) + math.pow(v.velocityZ,2));};",
          "v.camouflaged = q.property('mnp_ci:octopus_state') == 'camouflaged' && q.is_in_water && q.surface_particle_color.a > 0;",
          "v.yaw = math.lerprotate(v.camouflaged ? math.round(v.yaw / 90) * 90 : (v.is_swimming ? math.atan2(v.velocityZ, v.velocityX) - 90 : q.body_y_rotation), v.yaw, math.exp((-0.5 - v.camouflaged * 3 - v.is_swimming) * q.delta_time));",
          "v.pitch = math.lerprotate(!v.camouflaged * (v.is_swimming ? 90 + math.asin(-v.velocityY/v.magn) : 0), v.pitch, math.exp((-0.5 - v.camouflaged * 3) * q.delta_time));",
          "v.roll = math.lerprotate(!v.camouflaged * v.is_swimming * 180, v.roll, math.exp((-0.5 - v.camouflaged * 2) * q.delta_time));",
          "v.head1_rot = math.lerp((v.is_swimming || v.camouflaged) * 67.5, v.head1_rot, math.exp((-3 - v.camouflaged * 2) * q.delta_time));",
          "v.tentacle_rot = math.atan(2*math.sin(q.life_time*180))/math.atan(2)*-25-25;",
          "v.tentacletip_rot = math.cos(q.life_time*180)*25-5;",
          "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": [
          "controller1",
          "controller2",
          "swim.angle"
        ]
      },
      "animations": {
        "controller1": "controller.animation.mnp_ci.octopus1",
        "controller2": "controller.animation.mnp_ci.octopus2",
        "walk": "animation.mnp_ci.octopus.walk",
        "idle.underwater": "animation.mnp_ci.octopus.idle.underwater",
        "walk.underwater": "animation.mnp_ci.octopus.walk.underwater",
        "swim": "animation.mnp_ci.octopus.swim",
        "swim.angle": "animation.mnp_ci.octopus.swim.angle",
        "camouflaged": "animation.mnp_ci.octopus.camouflaged",
        "peek": "animation.mnp_ci.octopus.peek",
        "block_align": "animation.mnp_ci.octopus.block_align"
      },
      "particle_effects": {
        "texture_change": "mnp_ci:octopus_texture_change"
      },
      "render_controllers": [
        "controller.render.default"
      ],
      "spawn_egg": {
        "texture": "mnp_ci:spawn_egg_animal_octopus"
      }
    }
  }
}