minecraft-datapacks/datapacks/armour_statues-2-6-0/data/as/functions/storage_in.mcfunction

9 lines
732 B
Mcfunction
Raw Permalink Normal View History

2020-03-19 15:59:23 +01:00
#
# 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:"ArmourStatuesV2"}}}] 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:"ArmourStatuesV2" }}]}] unless entity @s[nbt={SelectedItem:{id:"minecraft:written_book", tag:{datapack:"ArmourStatuesV2"}}}] run data modify storage customizable_armor_stands:book_storage SavedItem set from entity @s Inventory[{Slot:-106b}]