Recipes Overview [Minecraft 1.21 and 1.21.1] - mezz/JustEnoughItems GitHub Wiki
[!NOTE] Version note: This page covers recipe integration for Minecraft 1.21 and 1.21.1.
Other recipe overview pages:
- Minecraft 1.21.11, 26.1.2, and 26.2: Recipes Overview
- Minecraft 1.16.5, 1.18.2, 1.19.2, and 1.20.1: Recipes Overview
- Minecraft 1.12.2: Recipes Overview
Recipes Overview
JEI automatically includes many vanilla recipe types through RecipeTypes, including crafting, stonecutting, cooking, brewing, smithing, composting, and ingredient information pages.
If you need to customize how one of your vanilla crafting or smithing recipes displays, use registerVanillaCategoryExtensions.
Modded Recipes
For a custom machine or other custom recipe display, create a JEI recipe type and category.
public static final RecipeType<CrusherRecipe> CRUSHING =
RecipeType.create("examplemod", "crushing", CrusherRecipe.class);
Then implement the plugin stages that match your integration:
- In
registerCategories, register anIRecipeCategoryfor the recipe type. - In
registerRecipes, callIRecipeRegistration.addRecipes(recipeType, recipes). - In
registerRecipeCatalysts, callIRecipeCatalystRegistration.addRecipeCatalysts(recipeType, station)for the block or item that opens the recipe category. - In
registerRecipeTransferHandlers, register transfer support if the+button should move ingredients into your menu. - In
registerGuiHandlers, add recipe click areas, ghost ingredient support, or screen exclusion areas for your GUI.
Example registration:
@Override
public void registerCategories(IRecipeCategoryRegistration registration) {
IGuiHelper guiHelper = registration.getJeiHelpers().getGuiHelper();
registration.addRecipeCategories(new CrusherRecipeCategory(guiHelper));
}
@Override
public void registerRecipes(IRecipeRegistration registration) {
List<CrusherRecipe> recipes = getCrusherRecipes();
registration.addRecipes(CRUSHING, recipes);
}
@Override
public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) {
registration.addRecipeCatalysts(CRUSHING, ModBlocks.CRUSHER);
}
The recipe type must be the same object everywhere: the category's getRecipeType, addRecipes, addRecipeCatalysts, recipe transfer handlers, and click areas should all refer to the same RecipeType.