Plot Armour is a Fabric mod that let's you restore your inventory and tp to where you died. Every death is completely normal: your items drop, your XP spills, and you respawn at your bed or spawn. In the background, Plot Armour saves a snapshot of you from the moment before you died.
If you want to undo that death, /plotarmor restore puts back your inventory, XP, hunger and potion effects exactly as they were. /plotarmor tp then takes you back to where you died, or the nearest safe spot. The items left on the ground are cleaned up so nothing gets duplicated, and it works in hardcore too.
Requires Fabric API. Commands need OP (cheats on in singleplayer).
Only required server side.