
# -> Tag mortar
tag @s add OverlyRealistic.Block.MortarInteractedWith

# -> Reset interaction type
scoreboard players set #or.mortar_interaction_type OverlyRealistic.General.ArbitraryData 0

# -> Interaction call
execute on target at @s run \
    function overly_realistic:general/custom_blocks/mortar/player_interact_with_mortar

# --> Interaction types

# -> Remove items
execute if score #or.mortar_interaction_type OverlyRealistic.General.ArbitraryData matches 1 run \
    function overly_realistic:general/custom_blocks/mortar/interactions/int_remove_all_items

# -> Use pestle
execute if score #or.mortar_interaction_type OverlyRealistic.General.ArbitraryData matches 2 \
    if entity @s[tag=OverlyRealistic.Block.Mortar_Status_Filled] run \
        function overly_realistic:general/custom_blocks/mortar/interactions/int_use_pestle

# -> Add items
execute if score #or.mortar_interaction_type OverlyRealistic.General.ArbitraryData matches 3 run \
    function overly_realistic:general/custom_blocks/mortar/interactions/int_add_item_general

# -> Untag mortar
tag @s remove OverlyRealistic.Block.MortarInteractedWith
