Minecraft Data Packs / Quality of Life

SGrave - Never lose your items again!

  • check_circle Functions
  • check_circle Loot Tables
  • check_circle Predicates
  • 1,776 views, 9 today
  • 254 downloads, 0 today
Sul4ur's Avatar Sul4ur
Level 30 : Artisan Nerd
38
This data pack is in beta.
A lot of features and bug fixes has been planned for future.
Only works from Minecraft 1.19.4 to 1.20.4.
Not compatible with 1.20.5.

Death in Minecraft is a big problem. In Minecraft, when you die, your items will just yeet out of your inventory. Some get lost in lava, some get lost by explosions, and some get lost in the void. Not to mention, your dropped items which did survive will just despawn after 5 minutes. So you just basically lose most of your items just by dying.

Using keep inventory won't work, because it literally removes the purpose of dying. You won't need to walk all the way back to your base. You only need to just kill yourself.

This data pack fixes this problem by making deaths more friendly, but not too much to not make it too overpowered. It stores all your items in a safe place called "grave" when you die. Well, there are a lot of mods and data packs that also do the same thing, but this data pack is designed to be more customizable.

With this data pack, you won't ever need to worry that you lost all of your items. The only hard part is to get back to where you died.

Grave Spawning

Your grave won't just spawn exactly where you died. There are a few conditions for a grave being made:
  • If you die in a block, the grave will keep being moved one block up until it reaches a transparent block (something like rails, air and vines).
  • If there is another grave, the grave will be moved one block up.
  • If you die floating in air or in water, the grave will keep being moved one block down until it reaches a transparent block where there is a solid block below.
  • If you die below the void, the grave will attempt to spawn at y -1, following all the previous conditions, except that it won't move down.
Basically, your grave will try to find the nearest transparent block where there is a solid block below.
    Graves are invulnerable and the only way to destroy them is by opening the grave. They also have no hitbox, meaning you can easily walk through graves. Also, graves glow, so you can see them through walls. (Can be disabled in config) By default, graves despawn in 90 minutes.

    After a grave spawns, The exact location of your grave will be announced to you. The announcement should look something like this:

    SGrave - Never lose your items again! Minecraft Data Pack

    Notice the 1 in Grave #1. That is the grave ID, and it's important. It can be useful in a lot of scenarios.

    Opening a grave


    When you reach the location of your grave, you will see your head lying on the ground, along with a text display showing your name and your grave's ID.

    You can click on the grave to open he grave. All the items will be put in the exact same spot they were before you died, and you will collet 90% of the experience you've had before you died. (The percentage can be changed in the config.) If an item can't be put in your inventory, it will instead be dropped.

    You can also break a grave by sneak + left clicking, where all items will just drop.

    The items that are dropped from a grave being broken are invulnerable and can't be destroyed by things such as lava or explosions, and they take 45min to despawn. (Can be changed in the config.)

    Commands

    /trigger sgrave set <value>
    Sends the coordinates and the dimension of your grave to you.
     Set the value to 1 to locate your last grave.
     Set the value to 2 to locate your second last grave.
     Set the value to 3 to locate your third last grave.
     and so on...
     Any players (non-OPs and OPs) can use this command.

    /trigger sgrave.grave_info set <value>
    Shows info about the grave with the ID of the value you entered. Currently it only shows the location, the amount of experience, and its despawn timer, but it will also show the items as well.

     For example to show information about grave #4, use /trigger sgrave.grave_info set 4

     Any players (non-OPs and OPs) can use this command.


    /function sul4ur:sgrave/config
     Opens the config menu. Only OPs can use this command.

    SGrave - Never lose your items again! Minecraft Data Pack

    License
    This work is licensed under CC BY-NC-ND.

    License image & description

    One exception is made for video content, which can be monetized. However, you must give appropriate credit in the description of your video.
    CompatibilityMinecraft 1.19
    toMinecraft 1.20
    Tags

    2 Update Logs

    License change! : by Sul4ur 05/10/2024 2:05:02 pmMay 10th

    Now licensed under CC BY-NC-NA.
    LOAD MORE LOGS

    Create an account or sign in to comment.

    Vanlalruata
    05/10/2024 3:39 pm
    Level 1 : New Crafter
    Vanlalruata's Avatar
    This is a good alternative to keepinventory! I'm conisdering to use it!
    2
    Planet Minecraft

    Website

    © 2010 - 2024
    www.planetminecraft.com

    Welcome