
# -> If player is not holding a dye in their mainhand then return
execute unless items entity @p[tag=OverlyRealistic.Player.InteractedWithCustomBlock] weapon.mainhand #overly_realistic:dyes run \
    return fail

# -> Get player's dye
item replace entity 00000001-0000-002b-0000-00010000002b contents from entity @p[tag=OverlyRealistic.Player.InteractedWithCustomBlock] weapon.mainhand

# -> Store dye name
data modify storage overly_realistic:temp_values temp_string_0 set string entity 00000001-0000-002b-0000-00010000002b item.id 10

# -> Dye cave painting
function overly_realistic:general/custom_blocks/cave_painting/dye_interaction/dye_painting with storage overly_realistic:temp_values

# -> Remove dye item
item modify entity @p[tag=OverlyRealistic.Player.InteractedWithCustomBlock,gamemode=!creative] weapon.mainhand overly_realistic:multipurpose/remove_one_item
