
# -> Advancement
advancement grant @s only overly_realistic:advancements/basket_uses/the_base_of_life
advancement grant @s only overly_realistic:advancements/stone_age/the_base_of_life

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

# -> Water bucket (old)
execute if items entity @s weapon.mainhand *[custom_data~{IsWaterBucket:1b}] run \
    return run \
        loot replace entity @s weapon.mainhand loot overly_realistic:items/iron_bucket_empty

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

# -> Water bottle
execute if items entity @s weapon.mainhand potion run \
    return run \
        item replace entity @s weapon.mainhand with glass_bottle[max_stack_size=1]

# -> Wooden bucket
execute if items entity @s weapon.mainhand *[custom_data~{or_bucket_specific:"wooden_bucket"}] run \
    return run \
        loot replace entity @s weapon.mainhand loot overly_realistic:items/wooden_bucket_empty
