Posted October 9, 20159 yr Ok so whenever I try to craft an item from my mod my game crashes but also how would I make it so I can craft an item using an item from my mod? oh and btw heres the crash report:http://pastebin.com/JdAhYnBG
October 9, 20159 yr you need to register and render the item BEFORE calling the recipe, I do all recipes in init and all item creating, registering, rendering etc in pre-init
October 9, 20159 yr Author I have done that when I first did it when I first made a recipe it worked but now that doesn't work so I'm not really sure
October 9, 20159 yr Author heres the whole class so you can see all of what ive done if that affects it:http://pastebin.com/5FTcqsFr
October 9, 20159 yr coaldust = new coaldust().setUnlocalizedName("coaldust").setTextureName("al:coaldust").setCreativeTab(tabAlchimia); add these methods in the constructor instead. you are not registering your textures try this... if (event.getSide() == Side.CLIENT) { regTexture(blockSau); } public void regTexture(Item item) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(MODID + ":" + item.getUnlocalizedName().substring(5), "inventory")); }
October 9, 20159 yr Author Oh I need to get rid of that block so why does it keep crashing whenever I try to craft something from my mod?
October 9, 20159 yr Oh I need to get rid of that block so why does it keep crashing whenever I try to craft something from my mod? the second half of my post....
October 9, 20159 yr Author Ok but the thing is I am registering my textures the items have textures but if I try to craft the items then my game crashes
October 9, 20159 yr Author But the thing is I just tried a tutorial and copied the code the person used and I can make a VANILLA item just fine in a different way that I programmed
October 9, 20159 yr ait but what does this have to do with the crafting recipe? honestly I'm just guessing. but it will add a new model mesh renderer to your item.
October 9, 20159 yr coaldust = new coaldust().setUnlocalizedName("coaldust").setTextureName("al:coaldust").setCreativeTab(tabAlchimia); add these methods in the constructor instead. you are not registering your textures try this... if (event.getSide() == Side.CLIENT) { regTexture(blockSau); } public void regTexture(Item item) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(MODID + ":" + item.getUnlocalizedName().substring(5), "inventory")); } No. Dont use event.getSide() , that is stuff proxies are made for.
October 10, 20159 yr For starters, please use more informative subject lines. A good subject line will draw people who know about your topic. Also, if you care enough to put info into your subject line, then more people will care enough to open your cry for help. Second, the minecraft version is 1.7.10, so let's not mention meshers. To the best of my knowledge, that horror doesn't appear until mc 1.8. Third, the crash was caused by a null pointer exception. Set a breakpoint at the offending statement, run again, and see what's null going into that statement. Then fix your code to give the null pointer an object. From the error message, it's a probably null itemstack, which can follow from a null item. Be sure that you have instantiated (and registered) each of your mod's items before you try to use them in recipes. A null itemStack can also follow from a malformed recipe. Be sure that every recipe defines all of its ingredients. In your code I see a recipe for "pestle" that starts with "ORO", but it only defines ingredient "S". This will fail. I also see a recipe for "crystal" starting with "ORO", and it has FOUR rows of ingredients. Have you defined a mod crafting table with four rows of input? If not, then this too will fail. The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.
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.