Skip to content

Instantly share code, notes, and snippets.

@misode
Last active October 11, 2019 13:18
Show Gist options
  • Save misode/342c3bfe74fcc1fbfe11192de89f9dfa to your computer and use it in GitHub Desktop.
Save misode/342c3bfe74fcc1fbfe11192de89f9dfa to your computer and use it in GitHub Desktop.
# Copy the last stone slot to a temp array
data modify storage temp Items[] set from block ~ ~ ~ Items[{id:"minecraft:stone"}]
# get the count in a scoreboard and remove one
execute store result storage temp Items[0].Count byte 1 run data get storage temp Items[0].Count 0.99
# Copy the last slot to the output items
data modify block ~ ~ ~ Items append from storage temp Items[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment