
# -> Particle
particle item{item:flint} ~0.5 ~0.5 ~0.5 0.4 0.4 0.4 0.01 4 normal @a

# -> Sound
playsound minecraft:block.stone.break block @a ~ ~ ~ 0.7 2

# -> On RNG, decrease stamina
execute if predicate overly_realistic:world/campfire/stamina_decrease_rng run \
    scoreboard players remove @s OverlyRealistic.Player.Stats.Stamina 1

# -> Altitude checks
execute if entity @s[y=150,dy=9999] run \
    scoreboard players remove @s OverlyRealistic.Player.Stats.Stamina 1
execute if entity @s[y=250,dy=9999] run \
    scoreboard players remove @s OverlyRealistic.Player.Stats.Stamina 1

# -> Increase flint flake uses
scoreboard players add @s OverlyRealistic.Player.FlintFlakeUses 1

# -> On RNG fail, return
execute unless score @s OverlyRealistic.Player.FlintFlakeUses matches 60.. \
    unless predicate overly_realistic:world/campfire/light_campfire_rng run \
        return fail

# -> Increase flint flake uses
scoreboard players reset @s OverlyRealistic.Player.FlintFlakeUses

# -> Intelligence gain RNG
execute if predicate overly_realistic:player/misc/intelligence_gain_general_rng run \
    function overly_realistic:players/intelligence/add_1_intelligence

# -> Particle
particle smoke ~0.5 ~0.5 ~0.5 0.05 0.05 0.05 0.01 10 normal @a

# -> Break flint flake
loot replace entity @s weapon.mainhand loot overly_realistic:items/sharpened_flint

# -> Particle
execute at @s \
    anchored eyes run \
        particle item{item:"flint"} ^ ^ ^0.1 0 0 0 0.1 3 normal @s

# -> Sound
playsound minecraft:block.calcite.break block @a ~0.5 ~0.5 ~0.5 0.4 2

# -> Give player a sharpened flint
#give @s flint\
    [\
        max_stack_size=1,\
        custom_data={"IsSharpenedFlint":1b},\
        item_name={text:"Sharpened Flint",color:"white"}\
    ]
