set {_f} to 1
set {_n} to level of fortune of player's tool set {_c} to (1/({_n}+2))
loop {_n} times: add 1 to {_a}
chance of {_c}:
add {_a} to {_f}
drop {_f} of iron ingot
Add a code snippet to your website: www.paste.org