{
  "format_version": "1.19.0",
  "minecraft:attachable": {
    "description": {
      "identifier": "tsu_morph:phantom_morph",
      "materials": {
        "default": "entity_alphatest",
        "vision": "tsu_entity_blend_exclusion"
      },
      "textures": {
        "default": "textures/entity/phantom",
        "vision": "textures/tsu/morph/entity/phantom_vision"
      },
      "geometry": {
        "default": "geometry.tsu_morph.phantom",
        "vision": "geometry.tsu_morph.vision"
      },
      "animations": {
        "phantom_base_pose": "animation.tsu_morph.phantom.base_pose",
        "move": "animation.tsu_morph.phantom.move",
        "phantom_base_pose_controller": "controller.animation.phantom.base_pose",

        "hurt_sounds": "controller.animation.tsu_morph.hurt_sounds",
        "idle_sounds": "animation.tsu_morph.idle_sounds"
      },
      "scripts": {
        "initialize": [
          "v.runtimeid = 0;",
          "v.tailrotx = -5.0;",
          "v.wingrotz = 0.0;",
          "v.smooth_vertical_speed = 0.0;",
          "v.smooth_yaw_speed = 0.0;"
        ],
        "pre_animation": [
          "variable.wingrotz = 16.0 * Math.sin((variable.runtimeid * 3 + query.life_time * 20.0) * 7.448454);",
          "variable.tailrotx = -5.0 * Math.sin((variable.runtimeid * 3 + query.life_time * 20.0) * 14.896908) - 5.0;",

          "v.smooth_vertical_speed = math.lerp(v.smooth_vertical_speed, q.vertical_speed, q.delta_time * 1);",
          "v.smooth_yaw_speed = math.lerp(v.smooth_yaw_speed, q.yaw_speed, q.delta_time * 1);",
          "v.display_fp = c.is_first_person && !q.is_in_ui && q.is_local_player;",
          "v.has_ability_item = q.is_item_name_any('slot.weapon.mainhand', 0, 'tsu_morph:creeper_ability');"
        ],
        "animate": [
          "phantom_base_pose",
          "move",
          "hurt_sounds",
          "idle_sounds"
        ]
      },
      "particle_effects": {
        "wing_dust": "minecraft:phantom_trail_particle"
      },
      "sound_effects": {
        "flap": "mob.phantom.flap",
        "hurt": "mob.phantom.hurt",
        "idle": "mob.phantom.idle"
      },
      "render_controllers": [
        {
          "controller.render.tsu_morph.default": "!v.display_fp"
        },
        {
          "controller.render.tsu_morph.vision": "v.display_fp"
        }
      ]
    }
  }
}