Skip to content
mezz edited this page Oct 26, 2016 · 11 revisions

Now that you're done with Getting Started, it's time to create your plugin.

Annotation Loading

JEI plugins implement the IModPlugin and are annotated with @JEIPlugin.
JEI uses the annotation to find your mod plugin class, and then creates an instance at runtime.

Loading this way has the advantage that you can keep all references to JEI in your plugin, separate from your other code. The plugin code will only get called with JEI is there, so it will never crash from missing classes.

Implementation

Plugins are broken into several stages. This page covers the register section in detail, follow links for the other sections.

  1. registerItemSubtypes
  • This is where you tell JEI how to handle items that have subtypes that depend on NBT or capabilities instead of meta.
  • See the page on Item Subtypes.
  1. registerIngredients
  • This is an advanced section where plugins tell JEI about ingredients.
  • The Vanilla plugin registers ItemStack and FluidStack as ingredients here.
  • Just about anything can be an ingredient. To add your own, see Non-Item Ingredients.
  1. register
  • The bulk of item and recipe registration is done here.
  • See the remainder of this page for a breakdown.
  1. onRuntimeAvailable
  • Mods that interact directly with JEI at runtime will get an instance of the IJeiRuntime here.
Clone this wiki locally