1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Save an item on death

Discussion in 'Requests' started by Ilarchis, Feb 12, 2022.

  1. Ilarchis

    Ilarchis Member

    Feb 12, 2022
    Likes Received:

    Suggested name:
    Doesn't matter

    Spigot/Skript Version:
    Spigot 1.16.5 / Skript 2.6.1

    What I want:
    So basically when a player dies and before he drops his inventory to remove an item from his inventory so that item is not droped, for example a pickaxe, and after he respawns that pickaxe to be given back to him(the enchants need to be saved too).

    Ideas for commands:
    No commands needed just called on death.

    Ideas for permissions:
    No premissions needed too
  2. Zhync

    Zhync Member

    Feb 11, 2022
    Likes Received:
    on death:
    event-entity is player
    drops contain pickaxe
    set {saveditems::%player%::*} to all pickaxes in drops
    remove all pickaxes from drops

    on respawn:
    wait 1 tick
    add {saveditems::%player%::*} to player's inventory
    delete {saveditems::%player%::*}

    # Untested, and I'd do that fancy text quote thing but I'm not entirely sure how. Hope this helps.

Share This Page