
# -> If there is water filled then return
execute if entity @s[tag=OverlyRealistic.Block.Basket_IsWaterLogged] run \
    return fail

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

# -> (@NOTE: why not just get the item from the global item display?)
# -> Get item
execute on target run \
    function overly_realistic:general/custom_blocks/basket/interactions/int_place_water_local_get_item

# -> Set water
summon minecraft:item_display ~ ~ ~ {Tags:["OverlyRealistic.Block.Basket_TempWater","OverlyRealistic.Block.Basket_IsWater"], item:{id:"poisonous_potato",components:{item_model:"overlyrealistic:misc/empty"}}, transformation: {left_rotation: [0.0f, 0.0f, 0.0f, 1.0f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [1.0f, 1.0f, 1.0f], translation: [0.0f, -0.756f, 0.0f]}}
execute align xyz run \
    ride @n[type=item_display,tag=OverlyRealistic.Block.Basket_TempWater,dx=0,dy=0,dz=0] mount @s
execute on passengers \
    if entity @s[tag=OverlyRealistic.Block.Basket_TempWater] run \
        function overly_realistic:general/custom_blocks/basket/interactions/int_place_water_edit_water

# -> Sound
playsound item.bucket.empty block @a ~ ~ ~ 0.45 1

# -> Operate on player
execute on target run \
    function overly_realistic:general/custom_blocks/basket/interactions/int_place_water_local
