Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/data/pskeep2/function/die.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,18 @@ advancement revoke @s only ~/
clear @s *[enchantments~[{enchantments:vanishing_curse}]]
# store items before and after clearing
data modify storage pskeep2:main items.all set from entity @s Inventory
data modify storage pskeep2:main items.all append from entity @s equipment.offhand
data modify storage pskeep2:main items.all append from entity @s equipment.head
data modify storage pskeep2:main items.all append from entity @s equipment.chest
data modify storage pskeep2:main items.all append from entity @s equipment.legs
data modify storage pskeep2:main items.all append from entity @s equipment.feet
clear @s #pskeep2:drop
data modify storage pskeep2:main items.left set from entity @s Inventory
data modify storage pskeep2:main items.left append from entity @s equipment.offhand
data modify storage pskeep2:main items.left append from entity @s equipment.head
data modify storage pskeep2:main items.left append from entity @s equipment.chest
data modify storage pskeep2:main items.left append from entity @s equipment.legs
data modify storage pskeep2:main items.left append from entity @s equipment.feet

# if no items are left after clearing but were before -- drop all
unless data storage pskeep2:main items.left[0] if data storage pskeep2:main items.all[0] function ~/drop_all_recursive:
Expand Down
6 changes: 4 additions & 2 deletions src/data/pskeep2/function/load.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ scoreboard objectives add pskeep2 dummy
store result score #keep_inventory pskeep2 gamerule keepInventory
if score #keep_inventory pskeep2 matches 0 tellraw @a {
"translate":"pskeep2.error.keep_inventory_off",
"fallback":"Gamerule \"keepInventory\" was set to \"true\" for \"KeepSomeInventory\" to work!",
"fallback":"Gamerule \"keep_inventory\" was set to \"true\" for \"KeepSomeInventory\" to work!",
"color":"red",
}
gamerule keepInventory true
execute in overworld run gamerule keep_inventory true
execute in the_nether run gamerule keep_inventory true
execute in the_end run gamerule keep_inventory true

scoreboard players set #2 pskeep2 2
scoreboard players set #5 pskeep2 5
Expand Down
2 changes: 1 addition & 1 deletion src/data/pskeep2/tags/item/drop.json

Large diffs are not rendered by default.