
# -> If gift has an item inside then return and drop item
execute if score #or.gift_has_item_interaction OverlyRealistic.General.ArbitraryData matches 1 \
    align xyz run \
        return run \
            function overly_realistic:general/custom_blocks/gift/interaction_actions/gift_drop_item

# -> If player is not holding anything then return
execute unless items entity @s weapon.mainhand * run \
    return fail

# -> If player is holding a gift then return
execute if items entity @s weapon.mainhand *[custom_data~{IsCustomBlock: "gift"}] run \
    return fail

# -> Get mainhand item
item replace entity 00000001-0000-002b-0000-00010000002b contents from entity @s weapon.mainhand

# -> Store item into gift
scoreboard players set #or.put_item_in_gift OverlyRealistic.General.ArbitraryData 1

# -> Sound
playsound block.wool.place block @a ~ ~ ~ 0.8 1.3

# -> Remove item from player
item replace entity @s weapon.mainhand with air
