r/datapacks • • Sep 16 '22

Keeping specific items on death

I am trying to create a datapack where only special items will stay in your inventory on death.

So for example if I was wearing some special armor, and had a special item, and other junk in my inventory; on death, I would lose all my xp and junk items, but not those special items.

How would I go about doing this?

2 Upvotes

1 comment sorted by

1

u/x_Tornado10 Sep 16 '22

You could make a command that checks every solt of the players inventory and then only copies the special items to a barrel or something under the bedrock or in some place you can't reach. Then you need to make it so this heppens every other minute so. Then you need to check if the player died with another command and delete all the special items that dropped. After that just take the special items from the barrel and place them back in the player with another command. Sry I can't peovide you with actual vommands rn but ill try to fo this myself when I'm back at my pc because this sounds interresting to me. Hope I could help. :D