-
Notifications
You must be signed in to change notification settings - Fork 305
Creating Plugins
gresh113 edited this page Jun 19, 2020
·
11 revisions
Now that you're done with gradle in Getting Started, it's time to create your plugin.
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 when JEI is there, so it will never crash from missing classes.
Plugins are broken into several stages.
registerItemSubtypes
- This is where plugins tell JEI how to handle items that have subtypes that depend on NBT or capabilities instead of meta.
- See the page on Item Subtypes.
registerIngredients
- This is an advanced section where plugins tell JEI about ingredients.
- The Vanilla plugin registers
ItemStack
andFluidStack
as ingredients here. - Just about anything can be an ingredient. To add your own, see Non-Item Ingredients.
register
- The bulk of item and recipe registration is done here.
- See the page on Recipes Overview
onRuntimeAvailable
- Mods that interact directly with JEI at runtime will get an instance of the
IJeiRuntime
here.
- Setup
- Item Ingredients
- Essential Extras
- Advanced
List of Plugin Implementations
- Setup
- Item Ingredients
- Working with Recipes
- Other