Minecraft Data Packs / Server Utility

selective keepInventory

  • check_circle Functions
  • 3,510 views, 3 today
  • 158 downloads, 0 today
  • 7
  • 5
  • 2
_L_3_0's Avatar _L_3_0
Level 21 : Expert 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.
CompatibilityMinecraft 1.16
toMinecraft 1.18
Tags

Create an account or sign in to comment.

GallantServer
09/26/2021 10:25 am
Level 1 : New Miner
GallantServer's Avatar
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 53 : Grandmaster Procrastinator
JuceDoesThings's Avatar
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
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome