Skip to content

Runtime JEI Integration [Minecraft 1.21.11 to 26.2]

mezz edited this page Sep 30, 2026 · 3 revisions

Note

Version note: This page covers Minecraft 1.21.11–26.3.

Related pages for other README-supported versions:

Runtime JEI Integration

Most JEI work should happen in registration methods. Use runtime integration when information changes after JEI has finished loading, such as server-defined recipes, progression locks, or UI buttons that open JEI.

Store IJeiRuntime when it is available and clear it when it becomes unavailable.

public final class ExampleJeiPlugin implements IModPlugin {
  private static IJeiRuntime runtime;

  @Override
  public void onRuntimeAvailable(IJeiRuntime jeiRuntime) {
    runtime = jeiRuntime;
  }

  @Override
  public void onRuntimeUnavailable() {
    runtime = null;
  }
}

Always handle runtime == null. JEI can unload and reload during client lifecycle changes.

Opening JEI

Use IRecipesGui to show whole categories, focused lookups, or specific recipe lists.

public static void showCrusherRecipes() {
  if (runtime == null) {
    return;
  }

  runtime.getRecipesGui().showTypes(List.of(ExampleJeiPlugin.CRUSHING));
}

To focus on an ingredient, create an IFocus with IJeiHelpers#getFocusFactory.

ItemStack output = new ItemStack(ModItems.CRUSHED_ORE);
IFocus<ItemStack> focus = runtime.getJeiHelpers()
  .getFocusFactory()
  .createFocus(RecipeIngredientRole.OUTPUT, VanillaTypes.ITEM_STACK, output);

runtime.getRecipesGui().show(focus);

Runtime Recipes

If recipes become available after JEI registration, add them through the recipe manager.

runtime.getRecipeManager()
  .addRecipes(ExampleJeiPlugin.CRUSHING, serverCrusherRecipes);

For progression or server rules, hide and unhide recipes instead of removing and re-adding everything.

runtime.getRecipeManager()
  .hideRecipes(ExampleJeiPlugin.CRUSHING, lockedRecipes);

runtime.getRecipeManager()
  .unhideRecipes(ExampleJeiPlugin.CRUSHING, unlockedRecipes);

You can also hide or unhide a whole category with hideRecipeCategory and unhideRecipeCategory.

Runtime Ingredients

Use IIngredientManager when ingredients are created or removed while the game is running.

runtime.getIngredientManager()
  .addIngredientsAtRuntime(VanillaTypes.ITEM_STACK, generatedStacks);

runtime.getIngredientManager()
  .removeIngredientsAtRuntime(VanillaTypes.ITEM_STACK, removedStacks);

Use this for real runtime changes. If the ingredient list is known during startup, prefer registerExtraIngredients.

Search Filter

Mods can read or set JEI's current ingredient filter.

String previousFilter = runtime.getIngredientFilter().getFilterText();
runtime.getIngredientFilter().setFilterText("@examplemod");

Set the filter only in direct response to player action. Avoid changing a player's search text automatically during normal gameplay.

Advanced Registration

registerAdvanced is for uncommon integrations such as recipe manager plugins, category decorators, recipe buttons, or disabling JEI features that conflict with large vanilla behavior changes.

Prefer normal registration hooks first:

  • registerRecipes for recipes and info pages.
  • registerRecipeCatalysts for crafting stations.
  • registerGuiHandlers for screen integration.
  • registerRecipeTransferHandlers for transfer support.
  • Runtime APIs for data that actually changes after JEI loads.

Home

List of Plugin Implementations

Minecraft 26.1.2–26.3

  1. Setup
  1. Ingredients and Search
  1. Recipes
  1. Screen Integration

Minecraft 1.21.11

  1. Setup
  1. Ingredients and Search
  1. Recipes
  1. Screen Integration

Minecraft 1.21–1.21.1

  1. Setup
  1. Ingredients and Search
  1. Recipes

Minecraft 1.19.2 and 1.20.1

  1. Setup
  1. Item Ingredients
  1. Working with Recipes
  1. Essential Extras
  1. Advanced

Minecraft 1.16.5

  1. Setup
  1. Item Ingredients
  1. Working with Recipes
  1. Essential Extras
  1. Advanced

Minecraft 1.12.2

  1. Setup
  1. Item Ingredients
  1. Working with Recipes
  1. Essential Extras
  1. Advanced

Clone this wiki locally