{
  "format_version": "1.20.80",
  "animation_controllers": {
    "controller.animation.tsu_morph.morphing_entity": {
      "initial_state": "default",
      "states": {
        "default": {
          "on_entry": [
            "/ride @p start_riding @s teleport_ride until_full"
          ],
          "transitions": [
            {
              "start": "q.has_rider"
            }
          ]
        },
        "start": {
          "on_entry": [
            "/execute as @p run playanimation @s animation.tsu_morph.player.invisible default 0 \"!q.is_riding\"",
            "/effect @p invisibility 999999 5 true"
          ],
          "transitions": [
            {
              "dismount": "!q.has_rider"
            },
            {
              "die": "q.health <= 0"
            }
          ]
        },
        "dismount": {
          "on_entry": [
            "/effect @p clear",
            "/execute as @p run scriptevent tsu_morph:morph_type player",
            "@s tsu_morph:despawn"
          ]
        },
        "die": {
          "on_entry": [
            "/effect @p clear",
            "/execute as @p run scriptevent tsu_morph:morph_type player",
            "@s tsu_morph:despawn",
            "/kill @p[c=1]"
          ]
        }
      }
    },
    "controller.animation.despawn_on_dismount": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "start": "q.is_riding"
            }
          ]
        },
        "start": {
          "transitions": [
            {
              "dismount": "!q.is_riding"
            }
          ]
        },
        "dismount": {
          "on_entry": [
            "/say dismounting bby",
            "@s tsu_morph:despawn"
          ]
        }
      }
    }
  }
}