KeepXP is a lightweight datapack that lets players keep their XP after death while leaving normal inventory behavior unchanged.
Commands /function keepxp:true /function keepxp:false /function keepxp:status