Thanks ROSDev!
I actually coded it myself, I don't remember exactly, but it wasn't that difficult. I just created a parameter for each item in the player's inventory and created a condition after death to only delete the items that don't have that parameter activated.