Code:
on death:
if victim is in region "elytra-pvp":
set {-drops::%victim's uuid%::*} to drops
drop 1 of chest named "&d%victim%'s &eDeath Package" with lore "&8[&7Right-Click&8] &7to claim!"
clear drops
on right click:
name of event-item contains "Death Package":
cancel event
set {_d} to name of event-item
replace all "&d" and "&e" and "'s Death Package" in {_d} with ""
set {_f} to {_d} parsed as offline player
if player can hold {-drops::%{_f}'s uuid%::*}:
give player {-drops::%{_f}'s uuid%::*}
delete {-drops::%{_f}'s uuid%::*}
remove event-item from player's inventory
play sound "ITEM_ARMOR_EQUIP_NETHERITE" with pitch 0 to players in radius 10 of player
play sound "ENTITY_PUFFER_FISH_BLOW_UP" with pitch 1 to players in radius 10 of player
else if player can't hold {-drops::%{_f}'s uuid%::*}:
send action bar "&cYou don't have enough space in invenotry" to player
play sound "BLOCK_ANVIL_PLACE" with pitch 1 to player
on left click:
name of event-item contains "Death Package":
open virtual chest inventory with size 5 named "Test" to player