Categories (Just Enough Items)
Description
Modify the Categories visible in JEI, each of which contain recipes and are associated with specific blocks, typically machines. Can also set the order of Categories.
Note
Hidden Categories will still take up load time, and recipes contained within can still be processed. This only prevents seeing Categories.
Tip
Use the command /gs jeiCategories to log the UIDs of all JEI Categories to the groovy.log file!
Identifier
Refer to this via any of the following:
mods.hei.category
mods.hei.Category
mods.jei.category/* Used as page default */
mods.jei.CategoryEditing Values
Sets the order of categories in JEI. Categories not included in the list will be placed at the end according to their normal order:
groovymods.jei.category.setOrder(List<String>)Sets the order of categories in JEI. Categories not included in the list will be placed at the end according to their normal order:
groovymods.jei.category.setOrder(String...)
Example
mods.jei.category.setOrder('minecraft.crafting', 'jei.information', 'minecraft.smelting', 'groovyscript:burning', 'groovyscript:explosion', 'groovyscript:fluid_recipe', 'groovyscript:piston_push', 'minecraft.anvil')Adding Entries
Recipe Builder
Just like other recipe types, the Categories also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
Category Builder
Create a builder for custom JEI categories.
groovymods.jei.category.categoryBuilder()
String. Sets the ID of the Category, which must be unique among all other Categories. Requires not empty.groovyid(String)List<IRecipeWrapper>. Sets theIRecipeWrappers used by the Category to generate entries.groovywrapper(IRecipeWrapper) wrapper(IRecipeWrapper...) wrapper(Collection<? extends IRecipeWrapper>)List<Object>. Sets the catalyst ingredients of the Category, which must belong to a class that has ingredient handling in JEI.groovycatalyst(Object) catalyst(Object...) catalyst(Collection<Object>)Function<IGuiHelper, ? extends IRecipeCategory<? extends IRecipeWrapper>>. Sets the function used to generate the category. Must be a Function accepting a single input parameterIGuiHelperand creating the class, which itself must extendIRecipeCategory. Requires not null.groovycategory(Function<IGuiHelper, ? extends IRecipeCategory<? extends IRecipeWrapper>>)
First validates the builder, returning
nulland outputting errors to the log file if the validation failed, then registers the builder and returns the registered object. (returnsnullorcom.cleanroommc.groovyscript.compat.mods.jei.Category$CustomCategory).groovyregister()
Example
mods.jei.category.categoryBuilder()
.id(classes.GenericRecipeCategory.UID)/* Note that `classes.GenericRecipeCategory` must be defined elsewhere, and this example presumes certain fields and methods exist. */
.category(guiHelper -> new classes.GenericRecipeCategory(guiHelper))
.catalyst(item('minecraft:clay'))
.wrapper(classes.GenericRecipeCategory.getRecipeWrappers())
.register()Removing Entries
Adds a new Category to JEI in the format
id,category,catalsyts,wrappers:groovymods.jei.category.add(Category.CustomCategory)Adds a new Category to JEI in the format
id,category,catalsyts,wrappers:groovymods.jei.category.add(String, Function<IGuiHelper, ? extends IRecipeCategory<? extends IRecipeWrapper>>, List<?>, List<? extends IRecipeWrapper>)Hides the given category from JEI:
groovymods.jei.category.hideCategory(String)Hides the given category from JEI:
groovymods.jei.category.remove(String)Hides all categories from JEI:
groovymods.jei.category.hideAll()
Example
mods.jei.category.hideCategory('minecraft.fuel')
mods.jei.category.hideAll()