Datapack that lets you save your XP on death, without KeepInventory. Fully customizable ! (Milestones, Recovery percentage, or Fixed XP loss)
Using /function gamerule:keep_xp_only/custom