Registry and Integrations
NER uses a lifecycle-based registration system. Instead of registering objects sporadically across your plugin, you define an integration class that implements NerPlugin. When NER compiles its registries, it will call your integration and pass a Registration instance.
1. Creating Your Integration Class
Create a new class and implement NerPlugin. The register method exposes the API to inject custom content into the recipe browser.
2. Understanding the Registry Methods
Here is a breakdown of the core registry mechanics available to you:
Search Filters (addFilter)
Adds custom search prefixes for the Anvil search menu. NER includes the following default filters:
@— Searches by Namespace (e.g.,@minecraft).:— Searches inside the item's Lore.#— Searches by the item's Tags (e.g.,#logs).$— Searches by the Crafting Station or provider (e.g.,$furnacefinds items smelted or used in a furnace).
Item Groups (addItemGroup)
Groups a List<ItemStack> under a single collapsible header in the main menu. Setting animate to true will cycle through the items in the group icon dynamically.
Craftability Checkers (addCraftabilityChecker)
When a player filters the main menu by "Craftable", NER needs to know how to verify if a player has the right items. You bind your custom recipe class to a checker logic here. CraftabilityUtil.hasIngredients() safely simulates taking items from a cached player inventory.
Deduplicators (addDeduplicator)
Useful when you have hundreds of NBT variations of the same item that share the exact same recipe (like potions or suspicious stews). It forces the indexer to treat them as a single generic item in the GUI to prevent clutter.
Modifiers (addModifier)
Useful if items should display differently depending on the player's permissions or progression. The modifier applies only visually when rendering the GUI button.
3. Hooking into NER
To finalize the setup, register your integration class during your plugin's onEnable() phase. Because you set load: BEFORE for NER in your paper-plugin.yml, NER is guaranteed to be ready.