This only works on single player games. You can use the free program Cheat Engine to hack into Minecraft and use it to duplicate items in your inventory. Get as many diamonds, obsidian blocks or gold ingots as you want!