Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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

  • 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

  • Author

heres the whole class so you can see all of what ive done if that affects it:http://pastebin.com/5FTcqsFr

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"));
    }

  • 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?

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....

  • 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

  • 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

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.

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.