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

Hey, I want to make a recipe with modded items. My basic recipe is:

public static void addRecipes(){
	ItemStack lavablock = new ItemStack(Main.lavablock);
	ItemStack lavaingot = new ItemStack(Main.lavaingot);

	GameRegistry.addRecipe(lavablock, "lll", "lll", "lll", 'l', lavaingot);
}

 

I registered the method in my main class and recipies without my modded items are working.

The Class of the lavablock is:

public class LavaBlock extends Block{

private final String name = "lavablock";
public LavaBlock(){
	super(Material.rock);
	setUnlocalizedName(Main.MODID + "_" + name);
	setCreativeTab(Main.CreativeTab1);
	GameRegistry.registerBlock(this, name);
}

public String getName(){
	return name;
}

}

The class of the lavaingot is the same one, but only for items.

In my Main class are the items / blocks registered like so:

    public static Block lavablock;
             public static Item lavaingot;


@EventHandler
    public void preInit(FMLPreInitializationEvent e) {
  	 	ModRecipes.addRecipes();
    }

@EventHandler
    public void init(FMLInitializationEvent e) {
    	lavablock = new LavaBlock();
    	lavaingot = new LavaIngot();
if(e.getSide() == Side.CLIENT)
           {
          //... ItemModelMesher register 

 

I hope for help :D

Battlemac

Items need to be initialized in preInit not init. The problem you are facing is that you are trying to add a recipe for Items that don't exist yet. Also stop using ItemModelMesher instead use ModelLoader.setCustomModelResourceLocation

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Guest
This topic is now closed to further replies.

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.