Created
March 19, 2015 03:59
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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