
# -> Particle
execute at @s \
    anchored eyes run \
        particle item{item:"flint"} ^ ^-0.25 ^0.75 0.1 0.1 0.1 0.001 1 normal @a

# -> If player has unset power then set power to 0
execute unless score @s OverlyRealistic.Player.UseItem_FlintFlake_BreakPower matches 0.. run \
    scoreboard players set @s OverlyRealistic.Player.UseItem_FlintFlake_BreakPower 0

# -> Tag player
tag @s add OverlyRealistic.Player.HasHitRockWithFlintFlake
tag @s add OverlyRealistic.Player.IsDoingRepetitiveTask

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

# -> 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

# --> Power usages

# -> power 0
execute if score @s OverlyRealistic.Player.UseItem_FlintFlake_BreakPower matches ..1 run \
    return run \
        function overly_realistic:players/items/flint_flake/power_usages/power_0

# -> power 1
execute if score @s OverlyRealistic.Player.UseItem_FlintFlake_BreakPower matches 2 run \
    return run \
        function overly_realistic:players/items/flint_flake/power_usages/power_1

# -> power 2
execute if score @s OverlyRealistic.Player.UseItem_FlintFlake_BreakPower matches 3 run \
    return run \
        function overly_realistic:players/items/flint_flake/power_usages/power_2

# -> power 3
execute if score @s OverlyRealistic.Player.UseItem_FlintFlake_BreakPower matches 4.. run \
    return run \
        function overly_realistic:players/items/flint_flake/power_usages/power_3
