Recipe Managers
Recipe Managers are crafting systems (like the Crafting Table, Furnace or Camp Fire) that use the Vanilla Data Pack JSON system.
Most Recipe Managers have the same removal methods but different methods to add recipes.
Recipe Managers are generally what you will be using to interact with recipes in the game, there are however some mods that don’t use the DataPack JSON system, and for those mods you would need to add and remove recipes differently.
Referencing Recipe Managers
Recipe Managers are usually referenced via a Bracket Handler (the exception being Vanilla Recipe Managers which can be referenced via a global value).
The Recipe manager format is:
Some examples are:
Vanilla Recipe Managers are special as they have dedicated Global Variables that allow you to reference them without using a BracketHandler.
The Vanilla Recipe Managers are:
Recipe Manager | Bracket Handler | Global Variable |
---|---|---|
Recipe Manager Blasting | Bracket Handler <recipetype:minecraft:blasting> | Global Variable blastFurnace |
Recipe Manager Campfire Cooking | Bracket Handler <recipetype:minecraft:campfire_cooking> | Global Variable campfire |
Recipe Manager Crafting | Bracket Handler <recipetype:minecraft:crafting> | Global Variable craftingTable |
Recipe Manager Smelting | Bracket Handler <recipetype:minecraft:smelting> | Global Variable furnace |
Recipe Manager Smithing | Bracket Handler <recipetype:minecraft:smithing> | Global Variable smithing |
Recipe Manager Smoking | Bracket Handler <recipetype:minecraft:smoking> | Global Variable smoker |
Recipe Manager Stone Cutting | Bracket Handler <recipetype:minecraft:stonecutting> | Global Variable stoneCutter |
You can find the full list of Recipe Managers through /ct dump recipetype
.
The Vanilla Recipe Managers can be referenced by either their Bracket Handler or the Global Variable, for example:
Is the same as doing:
The Global Variables just allow the Recipe Managers to be referenced easier.
The reason that not all Recipe Managers are given Global Variables is that there would be conflicting names if two different mods both added a machine with the same name, such as two mods adding Crushers.
Methods
This method gets a recipe by it’s name, and returns a Recipe.
You could use this method to get the ingredients
of a recipe and print the commandString
of each ingredient.
This method gets a list of recipes based on their outputs, and returns a list of Recipe.
You could use this method to get the ingredients
of all the recipes that output a certain item and print the commandString
of each ingredient of each recipe.
This method gets a list of all the recipes for the Recipe Manager and returns a list of Recipe.
You could use this method to get the ingredients
of all the recipes and print the commandString
of each ingredient of each recipe.
This method allows you to remove recipes from this Recipe Manager by the recipe’s output item.
An example use case for this method is removing the recipe for Sticks from the Crafting Table:
Another example of this method would be removing the Diamond Ore to Diamond recipe from the furnace:
This method allows you to remove recipes from this Recipe Manager by the recipe’s name.
An example use case for this method is removing the recipe for an Arrow from the Crafting Table:
This method allows you to remove recipes from this Recipe Manager based on the the recipe name’s modid.
There is an optional parameter that is used to exclude recipes from being removed.
Note: The name given to the RecipeFilter is just the path of the recipe id.
For example, if the recipe id is minecraft:orange_wool
, the name given will be orange_wool
. Another example would be the recipe id modid:path/name
, the name given will be path/name
An example use case for this method is removing all the recipe from “minecraft” from the Crafting Table:
Another use case would be removing all the recipes from “minecraft” excluding the recipe for Orange Wool.
This method allows you to remove recipes from this Recipe Manager by testing the recipe’s id against a regex pattern.
An example use case for this method is removing all recipes who’s id matches .*wool.*
(anything that has the work wool
in it).
This method allows you to remove all the recipes from the Recipe Manager.
An example use case for this method is removing all the Blast Furnace recipes.