execute as @s store result score @s nl.OreUses run data get entity @s SelectedItem.tag.Damage
gamerule doTileDrops false
execute if block ~1 ~ ~ #next_level:ore as @p run loot spawn ~1 ~-.16 ~ mine ~1 ~ ~ mainhand
execute if block ~1 ~ ~ #next_level:ore run setblock ~1 ~ ~ air destroy
execute if block ~-1 ~ ~ #next_level:ore as @p run loot spawn ~-1 ~-.16 ~ mine ~-1 ~ ~ mainhand
execute if block ~-1 ~ ~ #next_level:ore run setblock ~-1 ~ ~ air destroy
execute if block ~ ~1 ~ #next_level:ore as @p run loot spawn ~ ~.84 ~ mine ~ ~1 ~ mainhand
execute if block ~ ~1 ~ #next_level:ore run setblock ~ ~1 ~ air destroy
execute if block ~ ~-1 ~ #next_level:ore as @p run loot spawn ~ ~-1.16 ~ mine ~ ~-1 ~ mainhand
execute if block ~ ~-1 ~ #next_level:ore run setblock ~ ~-1 ~ air destroy
execute if block ~ ~ ~1 #next_level:ore as @p run loot spawn ~ ~-.16 ~1 mine ~ ~ ~1 mainhand
execute if block ~ ~ ~1 #next_level:ore run setblock ~ ~ ~1 air destroy
execute if block ~ ~ ~-1 #next_level:ore as @p run loot spawn ~ ~-.16 ~-1 mine ~ ~ ~-1 mainhand
execute if block ~ ~ ~-1 #next_level:ore run setblock ~ ~ ~-1 air destroy
gamerule doTileDrops true
scoreboard players add @s nl.OreUses 1
execute as @s store result entity @s SelectedItem.tag.Damage int 1 run scoreboard players get @s nl.OreUses