Minecraft Data Packs / Quality of Life

Individual Keep Inventory

  • check_circle Advancements
  • check_circle Functions
  • 2,005 views, 20 today
  • 174 downloads, 1 today
  • 8
  • 8
  • 1
sandwichentity's Avatar sandwichentity
Level 38 : Artisan Miner
10
With Individual Keep Inventory, each player can customize their gameplay experience without affecting the entire server. Whether you prefer the thrill of losing items upon death for an added challenge or crave the convenience of keeping your inventory intact, this data pack ensures that the choice is yours to make. No more server-wide compromises – now, every adventurer can tailor their survival journey according to their own preferences.

This data pack allows all players to toggle keepInventory on/off individually. There is also the option to disable players from individually changing their KeepInventory behavior, allowing it to be set by an operator instead.

To create this data pack I have modified another already existing data pack called "Keep Some Inventory" by PuckiSilver, so all the original options from that datapack remain. The data pack is highly configurable for players who have KeepInventory disabled, allowing you to adjust item despawn timers, specify which items are dropped/kept upon death, and decide whether XP is dropped/kept.


By default all players will have keepInventory disabled and will drop all items and XP upon death. Each player can then enable/disable keepInventory using the command - /trigger keepInventory


Change a player's keepInventory setting - /tag username add|remove pskeepEnabled

You can change what items are kept/dropped at - /data/ps-keep/tags/items/drop_on_death.json

Change ingame config - /function ps-keep:config


Config options:

These are adjustments for players who have keepInventory disabled:


Item despawn offset, is the time subtracted from the default 5 minutes despawn timer in ticks.
  The default is -6000 ticks, with this you get 5 minutes extra, so your items despawn after 10 minutes.
  Setting it to 5999 will mean, that they despawn after just a single tick.
  If you set it to -32768, items after death will stay for over 32 minutes.

Keep Experience determines if experience will drop upon death.
  0 - Default, you will drop all of your experience where you died.
  1 - You keep all your experience with you, like how the keepInventory gamerule works.

Keep Items determines what items will drop upon death.
  0 - Default, you will drop all your items, but keep any experience, the items don't splatter and the item despawn time offset will still apply as expected.
  1 - You only drop resources, but no equipment. (You can see all items that are kept here.)
  2 - You will keep all your items while still being able to drop your experience.

Player keepInventory trigger determines if indivudal players can enable/disable keepInventory.
  0 - Players must be tagged by an operator to have keepInventory enabled. (/tag username add|remove pskeepEnabled)
  1 - Players can individually toggle keepInventory. (/trigger keepInventory)

keepInventory player list will show all players with keepInventory enabled, simply hover your mouse.

CreditPuckiSilver
CompatibilityMinecraft 1.20
Tags

Create an account or sign in to comment.

3
02/17/2024 5:17 pm
Level 1 : New Miner
User5022582G
User5022582G's Avatar
Omg this is so good for me cuz I get so scared about losing my stuff
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome