Repository navigation
Recipe Categories [Minecraft 1.16.5 to 1.18.2]
Note
Version note: This page covers recipe categories for Minecraft 1.16.5–1.20.1. Use the API Javadocs for exact class and method names on the version you target.
Other recipe category pages:
- Minecraft 1.12.2: Recipe Categories
- Minecraft 1.21–26.3: Recipe Categories
A recipe category defines everything that's common across entire categories of recipes. These include, but are not limited to: "crafting", "cooking" (for all furnace types), and "brewing".
Create a new class, which implements IRecipeCategory<YourRecipeClass>. The interface outlines functions that need and can be implemented, which are described below.
- (REQUIRED) getUid() - Returns a
ResourceLocationthat represents the category. Returning something along the lines ofnew ResourceLocations("yourmodid", "yourcraftingsystem")will generally do the trick here. - (REQUIRED) getRecipeClass() - Returns the class of the recipe that your category uses.
return YourRecipeClass.classis what you'll want to use here, assumingYourRecipeClassis indeed the name of your recipe class. - (REQUIRED) getTitle() - Returns the title used for your category. For example, all anvil recipes use the title "Anvil" here.
- (REQUIRED) getBackground() - Returns the background used for your category. The
IGuiHelperhas methods that can help manipulate the image used for this. - (REQUIRED) getIcon() - Returns the icon used for your category. For example, anvil recipes return the item representation of an anvil here. To do this easily, you can use
IGuiHelper.createDrawableIngredient(new ItemStack(YourItem)). - (REQUIRED) setIngredients() - A function called for all your recipes to set the inputs and outputs. The
IIngredientsparameter here is where you'll want to set your inputs and outputs. - (REQUIRED) setRecipe() - A function used to "put" the items of your recipe into place.
- (OPTIONAL) draw() - Used to draw any additional information when displaying a recipe. JEI uses this to draw the experience required text for anvil recipes.
- (OPTIONAL) getTooltipStrings() - Gets the tooltips to display based on the X and Y position of the mouse.
- (OPTIONAL) handleClick() - Allows for handling of a mouse click.
- (OPTIONAL) isHandled() - Whether or not the recipe has been handled.
It may be best to take a look at IRecipeCategory in the API Javadocs for your target Minecraft version if any of this seems confusing.
Once you have a finished recipe category, it's pretty simple to register! Make sure you've created a JEI plugin, then inside of registerCategories, call IRecipeCategoryRegistration.addRecipeCategory(new YourModCategory()).
List of Plugin Implementations
- Setup
- Ingredients and Search
- Recipes
- Overview/What To Do
- Custom Machine Recipes
- Recipe Categories
- Recipe Transfer
- Vanilla Recipe Extensions
- Screen Integration
- Setup
- Ingredients and Search
- Recipes
- Overview/What To Do
- Custom Machine Recipes
- Recipe Categories
- Recipe Transfer
- Vanilla Recipe Extensions
- Screen Integration
- Setup
- Ingredients and Search
- Recipes
- Setup
- Item Ingredients
- Working with Recipes
- Essential Extras
- Advanced
- Setup
- Item Ingredients
- Working with Recipes
- Essential Extras
- Advanced
- Setup
- Item Ingredients
- Working with Recipes
- Essential Extras
- Advanced