1
0
mirror of https://github.com/LZStealth/armor-statues.git synced 2025-06-07 17:16:44 +01:00
armor-statues/data/armor_statues/functions/storage_in.mcfunction
2021-04-17 12:07:53 +02:00

9 lines
721 B
MCFunction

#
# Description: Copies player book from mainhand or offhand into storage
# Called by: as_statue:trigger\copy as_statue:trigger\paste
# Entity @s: player
#
# Temp storage to copy
#
execute if entity @s[nbt={SelectedItem:{id:"minecraft:written_book", tag:{datapack:"ArmorStatuesV2"}}}] run data modify storage customizable_armor_stands:book_storage SavedItem set from entity @s SelectedItem
execute if entity @s[nbt={Inventory:[{id:"minecraft:written_book", Slot:-106b, tag:{datapack:"ArmorStatuesV2" }}]}] unless entity @s[nbt={SelectedItem:{id:"minecraft:written_book", tag:{datapack:"ArmorStatuesV2"}}}] run data modify storage customizable_armor_stands:book_storage SavedItem set from entity @s Inventory[{Slot:-106b}]