{
  "format_version": "1.19.0",
  "minecraft:attachable": {
    "description": {
      "identifier": "tsu_morph:magma_cube_morph",
      "materials": {
        "default": "entity_emissive_alpha",
        "vision": "tsu_entity_blend_multiply"
      },
      "textures": {
        "default": "textures/entity/slime/magmacube",
        "vision": "textures/tsu/morph/entity/magma_vision"
      },
      "geometry": {
        "default": "geometry.lavaslime",
        "vision": "geometry.tsu_morph.vision"
      },
      "animations": {
        "walk": "animation.tsu_morph.slime.walk",
        "sneaking": "animation.tsu_morph.slime.sneaking",
        "stretch": "animation.magma_cube.move",
        "scale": "animation.tsu_morph.slime.scale",

        "step_sounds": "controller.animation.tsu_morph.step_sounds"
      },
      "sound_effects": {
        "step": "mob.magmacube.jump"
      },
      "scripts": {
        "initialize": [
          "v.previous_speed = q.vertical_speed;",
          "v.step_interval = 0.1;"
        ],
        "pre_animation": [
          "v.display_fp = c.is_first_person && !q.is_in_ui && q.is_local_player;",
          "v.size = q.health > 10 ? 4 : (q.health > 5 ? 2 : 1);",
          "v.smooth_vertical_speed = math.lerp(v.smooth_vertical_speed ?? 0, q.vertical_speed, 0.5);",
          "variable.slime_squish_factor = math.abs(v.smooth_vertical_speed)/30;"
        ],
        "animate": [
          "stretch",
          "scale",
          "step_sounds",
          {
            "walk": "q.is_on_ground ? q.modified_move_speed : 0"
          }
        ]
      },
      "render_controllers": [
        {
          "controller.render.tsu_morph.default": "!v.display_fp"
        },
        {
          "controller.render.tsu_morph.vision": "v.display_fp"
        }
      ]
    }
  }
}