How do I make my friends keep their stuff when they die in Terraria?
This is actually your friends fault. If you don't want to lose items on death you need to set your character to softcore while creating them. Your friends must have accidentally set theirs to mediumcore without thinking about it.
Sadly there is no way to set a character to softcore after creating them so your friends will need to make new characters if they want to keep their items after they die. They can put any items they have on their current character in a chest and then pick them all back up when they make a new character.
Why?
When you create a character, you can select difficulty, which impact your losses upon death:
- Softcore: Softcore characters drop half (3/4 on Expert mode) of their coins when killed by an enemy.
- Mediumcore: Mediumcore characters drop all of their items upon death, including all coins and ammo.
- Hardcore: Hardcore characters die permanently, and drop all of their items upon death, including coins and ammo, which other players can then collect in multiplayer.
So it's because of your friend character settings, not your host/world settings.
Solution
Keep your items in chests/bank, only bring the necessaries on the character. Better, bring a Piggy Bank or a Money Trough and store items in it frequently.
If your friends accept cheating, they can set the character type to Softcore by edit their save file using some save editor like Terrasavr (remember to backup, it can break your saves).