
# -> If basket already has additionals of base type then return
execute if entity @s[tag=OverlyRealistic.Block.Basket_Status_HasAdditionalsBase] run \
    return fail

# -> Check for 9 sweet berries
#scoreboard players set #or.global OverlyRealistic.General.ArbitraryData 0
#execute store result score #or.global OverlyRealistic.General.ArbitraryData run \
    data get storage overly_realistic:temp_values temp_basket_items[{id:"minecraft:sweet_berries"}]
#tellraw @a {score:{name:"#or.global",objective:"OverlyRealistic.General.ArbitraryData"}}
#execute unless score #or.global OverlyRealistic.General.ArbitraryData matches 9.. run \
    return fail

# -> Advancement
execute on target run \
    advancement grant @s only overly_realistic:advancements/basket_uses/berry_well

# -> Increase cookery XP
execute on target run \
    function overly_realistic:players/wisdom/cookery/add_to_skill_xp_c_prepare_additional_in_basket

# -> Create new display
summon minecraft:item_display ~ ~ ~ {Tags:["OverlyRealistic.Block.Basket_Display_SweetBerryBase","OverlyRealistic.Block.Basket_Display_IsAdditional"],item: {id: "minecraft:nether_wart_block",components:{item_model:"overlyrealistic:blocks/basket_additionals/sweet_berry_additional_base"}}, transformation: {left_rotation: [0.0f, 0.0f, 0.0f, 1.0f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [0.875f, 0.5625f, 0.875f], translation: [-0.4375f, -0.900f, -0.4375f]}}

# -> Attach new display
ride @n[type=item_display,tag=OverlyRealistic.Block.Basket_Display_SweetBerryBase,distance=..0.5] mount @s

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

# -> Remove items
function overly_realistic:general/custom_blocks/basket/interactions/int_remove_all_items_no_drop
