insert the command:
/worldconfig deathPunishment keep
in the chat to keep your items upon death. if you don't like corpserunning to recover your items but also don't want to keep your inventory for the sake of challenge there was a mod which store your inventory in a skeleton upon death:
https://www.vintagestory.at/forums/topic/3784-player-corpse/?tab=comments#comment-15850
(you must drag the Zip file in the mod folder of the game to add a mod)