Save an item on death

  • 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!


Feb 12, 2022

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
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.