Data Packs Server Utility

selective keepInventory

  • 4.4k views 0 today
  • save_alt 200 downloads
Compatibility
Minecraft 1.16
to version
Minecraft 1.18
Changes include
  • Functions
  • 7
  • 6
  • 2
_L_3_0
Lvl 21Expert Miner
4
Small datapack that allows for the keepInventory gamerule to be applied to individual players on a server.

Give all players that are supposed to keep their inventories the tag 'keepInventory'. All other player will drop theirs on death.
The gamerule keepInventory must be set to true for this to work.

Since this is an early prototype and proof of concept, only items get dropped and not the XP.
I did not test this on a server. Feedback is welcome.

Do with this whatever you want as long as you don't claim it as your own.

More like this

  Have something to say?

GallantServer
09/26/2021 10:25 am
Level 1 : New Miner
I don't know if this was the intended effect, but currently if someone dies without the "keepInventory" tag on, their items don't drop, they're just deleted.
1
JuceDoesThings
09/03/2021 10:41 pm
Level 57 : Grandmaster Procrastinator
I have a fix for the XP for you. Make it so that player XP is stored to a scoreboard and when they die, a single XP orb summons and then the value of it is set to the scoreboard value
2

Welcome