SmithingRecipeManager
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.recipe.SmithingRecipeManager;
Description
Implements
SmithingRecipeManager
implements the following interfaces:
IRecipeManager<SmithingRecipe>
,CommandStringDisplayable
Undocumented Interfaces
Comparable<Enum>
,Iterable<Recipe>
Enum Constants
SmithingRecipeManager is an enum with 1 constant. It is accessible like so:
SmithingRecipeManager.INSTANCE
Members
addJsonRecipe(name as string, mapData as MapData)
Adds a recipe based on a provided IData. The provided IData should represent a DataPack json, this effectively allows you to register recipes for any DataPack supporting RecipeType systems.script.zs
smithing.addJsonRecipe("recipe_name", {ingredient: <item:minecraft:gold_ore>,result: <item:minecraft:cooked_porkchop>.registryName,experience: 0.35 as float,cookingtime:100});
addTransformRecipe(recipeName as string, result as IItemStack, template as IIngredient, base as IIngredient, addition as IIngredient)
Adds a new transform recipe to the smithing table.script.zs
// SmithingRecipeManager.addTransformRecipe(recipeName as string, result as IItemStack, template as IIngredient, base as IIngredient, addition as IIngredient);smithing.addTransformRecipe("recipe_name", <item:minecraft:golden_apple>, myIIngredient, <item:minecraft:apple>, <tag:items:forge:ingots/gold>);
Parameters:
recipeName: string
Type: string
- Name of the recipe. addTrimRecipe(recipeName as string, template as IIngredient, base as IIngredient, addition as IIngredient)
Adds a new trim recipe to the smithing table.script.zs
// SmithingRecipeManager.addTrimRecipe(recipeName as string, template as IIngredient, base as IIngredient, addition as IIngredient);smithing.addTrimRecipe("recipe_name", myIIngredient, <item:minecraft:apple>, <tag:items:forge:ingots/gold>);
Parameters:
recipeName: string
Type: string
- Name of the recipe. Getter
Returns the BEP to get this thingyscript.zs
// SmithingRecipeManager.commandString as stringsmithing.commandString
Return Type:
string
commandString() as string
Returns the BEP to get this thingyscript.zs
// SmithingRecipeManager.commandString() as string;smithing.commandString();
Return Type:
string
getRecipesByOutput(output as IIngredient) as List<Recipe>
smithing.getRecipesByOutput(myIIngredient);
Parameters:
output: IIngredient
Type: IIngredient
Return Type:
List<Recipe>
Getter
Returns a map of all known recipes.script.zs
smithing.recipeMap
Return Type:
Recipe[ResourceLocation]
recipeMap() as Recipe[ResourceLocation]
Returns a map of all known recipes.script.zs
Returns: A Map of recipe name to recipe of all known recipes.
smithing.recipeMap();
Return Type:
Recipe[ResourceLocation]
remove(output as IIngredient)
Remove a recipe based on it's output.script.zs
smithing.remove(<tag:items:minecraft:wool>);
Parameters:
removeAll()
Remove all recipes in this registryscript.zs
// SmithingRecipeManager.removeAll();smithing.removeAll();
removeByInput(input as IItemStack)
Removes all recipes where the input contains the given IItemStack.script.zs
smithing.removeByInput(<item:minecraft:iron_ingot>);
Parameters:
removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false)
Remove recipe based on Registry name modidscript.zs
// SmithingRecipeManager.removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false);smithing.removeByModid("minecraft", myPredicate);
Parameters:
modid: string
Type: string
- modid of the recipes to remove exclude: function(t as string) as bool
(optional) Type: function(t as string) as bool
Default Value: (name as string) as bool => false
removeByName(names as string[])
Remove recipes based on Registry namesscript.zs
// SmithingRecipeManager.removeByName(names as string[]);smithing.removeByName(myString[]);
Parameters:
names: string[]
Type: string[]
- registry names of recipes to remove removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false)
Remove recipe based on regex with an added exclusion check, so you can remove the whole mod besides a few specified.script.zs
// SmithingRecipeManager.removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false);smithing.removeByRegex("\\d_\\d", (name as string) => {return name == "orange_wool";});
Parameters:
regex: string
Type: string
- regex to match against exclude: function(t as string) as bool
(optional) Type: function(t as string) as bool
Default Value: (name as string) as bool => false