Skip to content

Recipes

Lenni0451 edited this page Jan 4, 2023 · 2 revisions

The recipes module contains only the dynamic recipes. The other recipes have to be added manually.
To do anything with recipes you need to create a class extending the ARecipeRegistry class or use a pre-made class for a specific version.
Pre-made classes:

  • RecipeRegistry_v1_7
  • RecipeRegistry_v1_8

The recipe registry not only contains crafting recipes but also smelting and villager recipes.

Registering a crafting recipe

There is no default implementation for shapeless or shaped recipes. You have to create your own class implementing ICraftingRecipe or use a pre-made class for a specific version.

recipeRegistry.registerCraftingRecipe(craftingRecipe);

Registering a smelting recipe

Smelting recipes only require an input item and a output item.
To register a smelting recipe you can use the registerFurnaceRecipe method:

recipeRegistry.registerFurnaceRecipe(inputStack, outputStack);

Registering a villager recipe

Villager recipes require an input item, second optional input item and output item.
Since villager recipes can be disabled there is another method with an additional boolean parameter.

recipeRegistry.registerFurnaceRecipe(inputStack1, intputStack2);
recipeRegistry.registerFurnaceRecipe(inputStack1, intputStack2, enabled);

Villager recipes are dynamically sent to the client so you have to clear the villager recipes list before adding new ones.

Clone this wiki locally