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

# -> Tag player for 1t cooldown
tag @s add OverlyRealistic.Player.HasSharpenedFlintFlake

# -> Schedule cooldown removal
schedule function overly_realistic:players/items/flint_flake/players_remove_cooldowns 2t append

# -> 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.25 ^0.75 0.1 0.1 0.1 0.001 5 normal @a

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

# -> Reset player data
function overly_realistic:players/items/flint_flake/player_not_looking_at_rock
