
# -> Tag basket
tag @s add OverlyRealistic.Block.Basket_InteractedWith

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

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

# -> If no interaction type is set then return
execute unless score #or.basket_interaction_type OverlyRealistic.General.ArbitraryData matches 1.. run \
    return fail

# --> Interaction types

# -> Stir basket
execute if score #or.basket_interaction_type OverlyRealistic.General.ArbitraryData matches 1 \
    positioned ~ ~0.5 ~ \
    align xyz \
    positioned ~0.5 ~0.5 ~0.5 run \
        function overly_realistic:general/custom_blocks/basket/interactions/int_stir

# -> Place water items
execute if score #or.basket_interaction_type OverlyRealistic.General.ArbitraryData matches 2 \
    positioned ~ ~0.5 ~ \
    align xyz \
    positioned ~0.5 ~0.5 ~0.5 run \
        function overly_realistic:general/custom_blocks/basket/interactions/int_place_water

# -> Get water items
execute if score #or.basket_interaction_type OverlyRealistic.General.ArbitraryData matches 3 \
    positioned ~ ~0.5 ~ \
    align xyz \
    positioned ~0.5 ~0.5 ~0.5 run \
        function overly_realistic:general/custom_blocks/basket/interactions/int_get_water

# -> Get remove all items
execute if score #or.basket_interaction_type OverlyRealistic.General.ArbitraryData matches 4 \
    positioned ~ ~0.5 ~ \
    align xyz \
    positioned ~0.5 ~0.5 ~0.5 run \
        function overly_realistic:general/custom_blocks/basket/interactions/int_remove_all_items

# -> Add items
execute if score #or.basket_interaction_type OverlyRealistic.General.ArbitraryData matches 5 \
    positioned ~ ~0.5 ~ \
    align xyz \
    positioned ~0.5 ~0.5 ~0.5 run \
        function overly_realistic:general/custom_blocks/basket/interactions/int_add_item_general

# -> Untag basket
tag @s remove OverlyRealistic.Block.Basket_InteractedWith
