KeepInventoryElse
uses your experience points like money. When you die your levels decide what items you keep. The more levels you have the valuable items you save.
Diamonds, emeralds and netherite are kept first.
Tools and armour can be protected with an enchantment called Soulbound.
This enchantment helps keep your gear when you die. It might break a little. The durability cost gets smaller if you have Unbreaking enchantment on your gear. You can also save your gear by spending some of your levels. The cost is based on the materials used to make the gear.
When you die you use up your XP of dropping it on the ground. You can change how the game works with the /keepinvelse command. This lets you decide what items are worth and how much durability you lose.
