I want players to break obsidian and get a nether star and that it goes straight into the inventory without dropping. so far that works and so does the fortune 1 enchantment. But when I use fortune 2 or 3 it acts as if I was using fortune 1, giving me 2 nether star. How can I make it so the other fortune levels work
Code:
on break of obsidian:
if player is holding diamond pickaxe:
if player's held item is enchanted with fortune 1:
cancel event
set block to air
give player 2 nether star
else if player's held item is enchanted with fortune 2:
cancel event
set block to air
give player 4 nether star
else if player's held item is enchanted with fortune 3:
cancel event
set block to air
give player 6 nether star
else if player's held item is enchanted with fortune 4:
cancel event
set block to air
give player 8 nether star
else:
cancel event
set block to air
give player nether star