
# -> If basket is heated then return
execute if score @s OverlyRealistic.World.BasketBoilTime matches 1.. run \
    return fail

# -> If basket is not shut then return
execute unless function overly_realistic:general/custom_blocks/basket/basket_is_shut run \
    return fail

# -> Add to fermentation time
scoreboard players add @s[tag=!OverlyRealistic.Block.Basket_Status_HasFermentedSweetBerryBase] OverlyRealistic.World.BasketSweetBerryFermentationTime 1

# -> Advancement
execute if entity @s[tag=!OverlyRealistic.Block.Basket_Status_HasFermentedSweetBerryBase] run \
    advancement grant @p[distance=..3,limit=10,sort=arbitrary] only overly_realistic:advancements/basket_uses/almost_alchemy

# -> If fermentation isn't maximized then return
execute unless score @s OverlyRealistic.World.BasketSweetBerryFermentationTime matches 3000.. run \
    return fail

# -> If fermentation has already happened then return
execute if entity @s[tag=OverlyRealistic.Block.Basket_Status_HasFermentedSweetBerryBase] run \
    return fail

# -> Reset fermentation value
scoreboard players set @s OverlyRealistic.World.BasketSweetBerryFermentationTime 3000

# -> Change additional display
execute on passengers run \
    data modify entity @s[type=item_display,tag=OverlyRealistic.Block.Basket_Display_SweetBerryBase] item.components."minecraft:item_model" set value "overlyrealistic:blocks/basket_additionals/fermented_sweet_berry_additional_base"

# -> Tag ent
tag @s add OverlyRealistic.Block.Basket_Status_HasFermentedSweetBerryBase