Skip to content

Instantly share code, notes, and snippets.

@Choonster
Created March 19, 2015 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Choonster/fdcbfdb593a546652a9a to your computer and use it in GitHub Desktop.
Save Choonster/fdcbfdb593a546652a9a to your computer and use it in GitHub Desktop.
Minecraft Forge 1.8-11.14.0.1290 - An example of how to instantiate and register items and use them in crafting recipes http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/2384674-minecraft-crashing-due-to-crafting-recipe-even
public class ModItems {
public static BladedWrist goldBladedWrist;
public static void initItems() { // Call this during preInit
goldBladedWrist = new BladedWrist(Item.ToolMaterial.GOLD); // Instantiate the Item
GameRegistry.registerItem(goldBladedWrist, "bladedWrist"); // Register it with FML
}
public static void addRecipes() { // Call this during init
GameRegistry.addRecipe(new ItemStack(goldBladedWrist), // Use existing instance of BladedWrist
" ",
" A ",
"ABA",
'A',
Items.gold_ingot,
'B',
Items.stick);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment