Contents

Prerequisites

Minecraft Version

1.6.4

Forge Build

This tutorial was written for Minecraft Forge recommended build 953 1.6.4

Registering an Ore

In this tutorial I am going to teach you how to use the ore dictionary feature of Minecraft Forge. In this tutorial I assume you know how to make a basic block and item and install Forge. We are going to start out with some basic code with nothing but a mod template. I have broken up Recipes, Name registration, and Ore Registration using the OreDictionary into separate methods for Organization(You should already know how to make a CommonProxy and ClientProxy before viewing this tutorial)

If you don't know what ore dictionary name you should assign to your ores then you might visit: Common Oredict names

Not a very functional copper ingot, but it's sufficient for this tutorial. You should already know how to implement a new item by now. Now we're going to add the ore dictionary code into our @Init method, which in copper's case is:

OreDictionary.registerOre("ingotCopper", new ItemStack(ingotCopper));

Replace the ingotCopper on the left with whatever you want to register your ore as. There is technically no incorrect name to register an item under, but don't expect any other mods to use your ore if you don't follow standards. The typical format is "itemType" such as "ingotCopper", "oreSilver" or "woodRubber". The documentation for IOreHandler lists some examples of ore registrations, but those are by no means a complete list, so don't feel limited by just those entries. All registering does is let Forge know "Hey, I have an item here of type 'ingotCopper' that other mods may also want to use." You can just as easily register flannel colored wool as "woolFlannel" if you think it'll be something other mods will be using.

In case you're confused about the new ItemStack() thing, that's a constructor of ItemStack, which basically means that it is a block or item, and can have a quantity and damage value. Don't use the quantities other than 1 while implementing the ore dictionary, though.

And that's it! Pretty simple, huh? Now, if your mod is installed alongside another mod that uses copper from the ore dictionary such as IndustrialCraft2 or Forestry, those mods will be able to use copper ingots from your mod in their recipes.

If you have a problem, message me on the MinecraftForge Forums. Username: Ghostrec35.
Final code:

Creating Recipes that use the Ore Dictionary

So, you now have copper ingots that other mods can use, but what if you want to use other mods' copper ingots? That's where the CraftingManager comes into play. Let's go back to the copper mod shown above. First off, if we want to use another mod's copper ingots, we should probably give copper ingots a use. Lets go with a simple recipe to make buckets out of copper ingots.

Now, copper ingots from this mod can be crafted into buckets, but other copper ingots can't. In order to add recipes for those copper ingots, we'll need to use the String you used to signify your ingot in the OreDictionary. In this case me merely have to change the Item ingotCopper to the String "ingotCopper".

Now your mod should be all set. Other mods will be able to use your copper ingots for their own recipes, and you can use other mods' copper ingots for your bucket recipe.

Credits

Originally made by: volcomrj (from LethalComboFilms)
Huge thanks to Methusaleh96 who taught volcromj almost everything he knows about modding.
Thanks to LexManos for the correction to his stupid mistake(s).