
# -> Debug particles
#particle happy_villager ~ ~ ~ 0 0 0 0.0001 1 force @a

# -> Set block
execute align xyz run \
    summon marker ~0.5 ~ ~0.5 {Tags:["OverlyRealistic.Block.WaterPlacementMarker"]}

# -> Create water placement
schedule function overly_realistic:players/items/water_bucket/block_placement_operate 1t

# -> If player is in creative then return
execute if entity @s[gamemode=creative] run \
    return fail

# -> Replace water bucket
execute if items entity @s weapon.mainhand *[custom_data~{or_bucket_specific:"iron_bucket",or_bucket_contents_type:"water"}] run \
    return run \
        loot replace entity @s weapon.mainhand loot overly_realistic:items/iron_bucket_empty
loot replace entity @s weapon.mainhand loot overly_realistic:items/iron_bucket_empty
