
# -> If there already is 10 sticks then return
execute if score @s OverlyRealistic.General.ArbitraryData matches 10.. run \
    return fail

# -> Add to stick amount and store value
execute store result storage overly_realistic:temp_values generic_value_0 int 1 run \
    scoreboard players add @s OverlyRealistic.General.ArbitraryData 1

# -> Expose stick amount
scoreboard players operation #or.exposed_stick_amount OverlyRealistic.General.ArbitraryData = @s OverlyRealistic.General.ArbitraryData

# -> Create stick
function overly_realistic:general/custom_blocks/dry_tinder/interactions/create_stick_entity with storage overly_realistic:temp_values

# -> Remove player's stick
execute on target run \
    item modify entity @s[gamemode=!creative] weapon.mainhand overly_realistic:multipurpose/remove_one_item

# -> Update text display
execute on passengers \
    if entity @s[tag=OverlyRealistic.Block.DryTinderText_Part_1] run \
        data modify entity @s text set value {"atlas":"items","sprite":"minecraft:item/stick","extra":[{"score":{name:"#or.exposed_stick_amount",objective:"OverlyRealistic.General.ArbitraryData"},"color":"black"},{"text":"/10","color":"black"}]}

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

# -> Untag attached item
execute on passengers run \
    tag @s remove OverlyRealistic.Block.DryTinder_Item_TempItem

# sound?