Do you, like me, think that the death penalty in Minecraft is too harsh? On the other hand, enabling keepInventory completely removes any penalty. This is very unreasonable. Why not seek a balance between dropping everything upon death and dropping nothing at all? There's no need to be all or nothing, right?
If you think the same way, then the datapack I tried to create will be your perfect choice.
Import my datapack when creating a world. It will, by default, enable 'no item drop on death,' but this does not mean that nothing drops at all. Players will drop a certain amount of experience points upon death based on the difficulty: in Peaceful mode, no experience levels are dropped; in Easy mode, 25% of experience levels are dropped; in Normal mode, 50% of experience levels are dropped; and in Hard mode, you will drop all your experience levels. The experience levels dropped in Easy and Normal modes are rounded up.
Additionally, if you die with an item that has the Curse of Vanishing enchantment in your inventory, that item will vanish as usual.
Finally, this datapack is not my original creation. It was modified and created based on the datapack from "github.com/clo4". I hope you enjoy my datapack, and at the same time, I hope you respect the original creator's work and offer recognition and support.