The RAW rules actually allow you a myriad of ways to “raise yourself from the dead”.
- Clone is tailor made to raise yourself from the dead.
- An Arcana Cleric can cast contingency with revivify as the contingent spell. (There’s other ways to do this but they’re either more complicated or setting specific.)
- A wizard can can cast contingency with danse macabre as the contingent spell. (This’ll have a very limited duration.)
- Magic jar can let you possess another creature to animate your own body if something happens to it while you’re “away”.
- If you’re a humanoid, hitting yourself with a finger of death just before you’re about die can let you rise as a zombie permanently under your own control at the start of your next turn.
- Make a simulacrum of yourself to raise the original you at your leisure.
- Summon a planar ally to raise you if you die within an agreed upon time frame. (Probably requires bribery.)
The whole concept of liches is basically raising yourself from the dead.
Also of note; Most reanimation spells (animate dead, create undead, raise dead, etc…) are instantaneous and can’t be ended by an antimagic field or dispel magic. (The same can’t always be said for a creator’s control. The creature(s) these spells create usually don’t die/cease to be animated when the creator’s control ends either though.)
I imagine the contingency + danse macabre version, or a variant of this, is what /u/Ghost33313@kbin.social what thinking of, since it would break with loss of concentration.