Posted February 24, 201312 yr Hi, I'm really new to Forge (I've been making bukkit plugins for a couple years) and am having trouble figuring out how to get a Material from an ID so that I can put it into a recipe. Any help would be appreciated. Thanks! Edit: I need the ID because the item is from a different mod.
February 24, 201312 yr I'm a bit confused, why would you need a "Material" for a crafting recipe? It only describes stuff like this material can burn, be pushed and so on. Looking at the Materail class, it does not have any ID. Could you please describe better your problem? mnn.getNativeLang() != English If I helped you please click on the "thank you" button.
February 24, 201312 yr Author I'm a bit confused, why would you need a "Material" for a crafting recipe? It only describes stuff like this material can burn, be pushed and so on. Looking at the Materail class, it does not have any ID. Could you please describe better your problem? Hmm the way Bukkit and Forge treat the word "Material" might be different. In minecraft you assign items an ID. For example, stone's ID is 1 and grass is 2 etc. Since the item is from an outside mod, I need to use the ID. I'm trying to use the ID for something like this: GameRegistry.addRecipe(new ItemStack(<item id>, 1), new Object[]{"XXX", "X X", Chatacter.valueOf('X'), <item id>});
February 24, 201312 yr Author Item IDs in mods are not stable. They can be changed via Configs. Don't rely on them. This is just for my own personal use so if it changes at some point I can just come in and change this
February 24, 201312 yr Author Well, then just use new ItemStack(ITEM_ID, amount, DAMAGE); oh lol... wow. I feel dumb. I didn't realize you needed to put damage.. I'll walk away in shame now. Thanks
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.