Adding Shapeless Crafting Recipes

If you haven’t already, check out the shaped crafting recipe tutorial. That’s needed before you can follow this tutorial.

Go to your ModRecipes class. If you don’t know what it is, you might want to read the shaped crafting tutorial I made.

I am going to add a recipe to craft the red diamond block back into nine red diamonds. So here’s the code you need to add:

GameRegistry.addShapelessRecipe(new ItemStack(ModItems.red_diamond, 9), ModBlocks.red_diamond_block);

The first parameter is the output, as an ItemStack. The second and forth parameters are what’s needed to make the item. For example, flint and steel is as follows:

GameRegistry.addShapelessRecipe(new ItemStack(Items.flint_and_steel), Items.iron_ingot, Items.flint);

If you want two of the same items, you can specify it twice, or use ItemStacks.

Leave a comment