on mine:
event-block is coal ore, deepslate coal ore, iron ore, deepslate iron ore, gold ore, deepslate gold ore, copper ore, or deepslate copper ore
set {_n} to nbt compound of player's tool
int tag "Smelter" of {_n} is 1
gamemode of player is survival
cancel the item drops
set {_fortune} to the level of fortune on player's tool
set {_no_bonus_chance} to 2 / ({_fortune} + 2)
set {_rand_pick} to a random number between 0 and 1
set {_num_drops} to 1
if {_rand_pick} is greater than {_no_bonus_chance}:
set {_num_drops} to a random integer between 1 and ({_fortune} + 1)
if event-block is coal ore or deepslate coal ore:
drop {_num_drops} of coal at event-block
else if event-block is iron ore or deepslate iron ore:
drop {_num_drops} of iron ingot at event-block
else if event-block is gold ore or deepslate gold ore:
drop {_num_drops} of gold ingot at event-block
else if event-block is copper ore or deepslate copper ore:
drop {_num_drops} of copper ingot at event-block
make 5 of flame particle at location of event-block with offset vector(2, 2, 2)
on load:
set {_i} to iron pickaxe named "Smelter's Pickaxe"
set {_n} to nbt compound of {_i}
set int tag "Smelter" of {_n} to 1
enchant {_i} with efficiency 2 and unbreaking 1
register new shaped recipe for {_i} named "Smelter's Pickaxe" using raw iron, raw iron, raw iron, coal, stick, coal, air, stick, and air with id "smelters_pickaxe"