Posted January 9, 201411 yr EDIT: The tutorial I linked from the wiki was missing a *very* important bit of code! GameRegistry.registerItem(genericItem,"Generic Item"); After adding this for each item, they both show up now. Now I just have to figure out why LanguageRegistry.addName isn't setting the in-game item name properly. /EDIT DISCLAIMER - I am new to Minecraft mod creation, please don't hate me for it. I promise I have coded before(although not in Java), and I am very good at taking a little bit of information a long way. I'm attempting to go off of the tutorial at http://www.minecraftforge.net/wiki/Basic_Items to create an item that I can select in Creative Mode. No grand schemes at the moment, I just want to put an item into the game. My code will compile and run, but the item doesn't show up. I feel like maybe the reason this isn't working is because item IDs have gone out the window - but I haven't yet figured out how to bridge the gap from the old tutorial code to working 1.7.2 code. Is there anyone who would be so kind as to post the basic 1.7.2 code/information needed to create an item? EDIT: Using Forge 10.12.0.997 The tutorial code in the Generic Class (parts relating to items): public class Generic { private static Item genericItem; private static Item genericIngot; @EventHandler public void preInit(FMLPreInitializationEvent event) { genericItem = new GenericItem(5000); genericIngot = new GenericItem(5001) .setMaxStackSize(16).setUnlocalizedName("genericIngot"); } @EventHandler public void load(FMLInitializationEvent event) { LanguageRegistry.addName(genericItem, "Generic Item"); LanguageRegistry.addName(genericIngot, "Generic Ingot"); } But for 1.7.2 itemId isn't a property of items, so I would think simply changing to THIS would work: @EventHandler public void preInit(FMLPreInitializationEvent event) { genericItem = new GenericItem(); genericIngot = new GenericItem().setMaxStackSize(16).setUnlocalizedName("genericIngot"); } But it doesn't seem to.
February 6, 201411 yr You must put the code into preinit, not into init www.youtube.com/HyCraftHD www.google.com/+HyCraftHDdeMC www.hycrafthd.de
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.