-
Notifications
You must be signed in to change notification settings - Fork 1
Creating A Plugin
Anvil Enchantments allows Developers to add their own recipes through a custom plugin. Doing this is SUPER easy!
There are somethings that my mod needs to get and use your plugin.
Your plugin class must be annotated with the @AnvilPlugin Annotation and must implement the IModPlugin interface.
This will have you implement (2) Two Methods, it is important that they are filled out properly.
Method 1
public String getPluginId();
Must return a string, should be the same as your ModId
Method 2
public void registerRecipes(IAnvilRegistry registry);
Where all your Recipes should go!
There are two ways to add a Recipe to the registry.
- addConfigRecipe -- Adds a recipe that is associated with a config file.
- addBaseRecipe -- Adds a recipe that is hardcoded in mod.
The real difference is whether or not players will be able to edit the recipe. If you don't want a recipe to be edited, use the addBaseRecipe function.
Final note, the plugins are gathered in the PreInitialization Stage to ensure that your mod will be loaded properly please put "before:anvils;" in your @Mod dependencies.