Different loot based on dimension

For example how can I make stone block drop blackstone in the nether and endstone in the end when mined? Or make a creeper drop glowstone the nether and pearls in the end.

Continue to help post