
# -> Modify item
function overly_realistic:players/items/sharpened_flint/knapping/item_edit/use_3_edit

# -> Get player's item
item replace entity 00000001-0000-002b-0000-00010000002b contents from entity @s weapon.mainhand

# -> Reset success
scoreboard players set #or.successful_sharpened_flint_knap OverlyRealistic.General.ArbitraryData 0

# -> Create new item
function overly_realistic:players/items/sharpened_flint/knapping/item_edit/get_item/create_item with entity 00000001-0000-002b-0000-00010000002b item.components."minecraft:custom_data".sharpened_flint_usage

# -> If the knapping was unsuccessful then reset the sharpened flint item
execute if score #or.successful_sharpened_flint_knap OverlyRealistic.General.ArbitraryData matches 0 run \
    loot replace entity @s weapon.mainhand loot overly_realistic:items/sharpened_flint

