
# -> Increase strip log time
scoreboard players add @s OverlyRealistic.Player.LogStripTime 1

# -> If strip log time >= 10 then play sound and reset time
execute if score @s OverlyRealistic.Player.LogStripTime matches 10.. run \
    function overly_realistic:players/items/axes/log_stripping/reset_strip_time

# -> If AxeStripUses != max then return
execute positioned ^ ^ ^0.1 \
    unless block ~ ~1 ~ #overly_realistic:spear_can_passthrough \
    unless score @s OverlyRealistic.Player.AxeStripUses matches 50.. run \
        return fail
execute unless score @s OverlyRealistic.Player.AxeStripUses matches 20.. run \
    return fail

# -> Reset stone hatchet uses
scoreboard players reset @s OverlyRealistic.Player.AxeStripUses

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

# -> Strip log
#execute summon item_display run \
    function overly_realistic:players/stone_hatchet_strip/strip_log

# -> If current block is a spruce log then drop resin
execute if block ~ ~ ~ #spruce_logs run \
    loot spawn ~ ~ ~ loot overly_realistic:items/resin_from_spruce_stripping

# -> Set block
function overly_realistic:players/items/axes/log_stripping/strip_log_set_block with storage overly_realistic:temp_values
