CustomBrewRecipes
This Fabric mod provides developers with the ability to create custom brewing recipes that support not only standard potions but also items with components or NBT data.
To work with the mod, simply call the method CustomBrewRecipeRegister.registerCustomRecipe() and specify the required items for the recipe. If you need to work with custom components, use the method CustomBrewRecipeRegister.registerCustomRecipeWithComponents(), passing either pre-made items with components or the corresponding NBT data.
There is also a version of the method for working with NBT that saves data to the CustomData component. You can check for the presence of specific component types or NBT fields without considering their values using the method CustomBrewRecipeRegister.registerCustomRecipeWithComponentPrescence().
To check for the presence of a specific field or component with a certain value, use the method CustomBrewRecipeRegister.registerCustomRecipeWithComponentType(). It's important to note that the output item must contain the full ComponentMap/NBT set, as it will be created during the process.
Setup
To add the mod to your project, make the following changes to your build.gradle file:
repositories {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
}
dependencies {
modImplementation "maven.modrinth:custombrewrecipes:<version>"
}
License
The mod is distributed under the CC0 license.