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 . CraftingTableRecipeManager;
CraftingTableRecipeManager
implements the following interfaces:
IRecipeManager <CraftingRecipe >
,CommandStringDisplayable
Undocumented Interfaces Comparable <Enum >
, Iterable <Recipe >
CraftingTableRecipeManager is an enum with 1 constant. It is accessible like so:
CraftingTableRecipeManager . INSTANCE
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. // CraftingTableRecipeManager.addJsonRecipe(name as string, mapData as MapData);
craftingTable . addJsonRecipe( "recipe_name" , {
ingredient: < item : minecraft:gold_ore > ,
result: < item : minecraft:cooked_porkchop > .registryName,
experience: 0.35 as float ,
Parameters:
name: string
Type: string
- name of the recipe
// CraftingTableRecipeManager.addShaped(recipeName as string, output as IItemStack, ingredients as IIngredient[][], recipeFunction as RecipeFunction2D = null);
craftingTable . addShaped(myString, myIItemStack, myIIngredient[][], myRecipeFunction2D);
Parameters:
recipeName: string
Type: string
Adds a mirrored shaped recipe to the crafting table. This method lets you provide a MirrorAxis
, which can be used to set which axis the recipe is mirrored on. Use cases are making a recipe only be mirrored vertically or only horizontally. // CraftingTableRecipeManager.addShapedMirrored(recipeName as string, mirrorAxis as MirrorAxis, output as IItemStack, ingredients as IIngredient[][], recipeFunction as RecipeFunction2D = null);
craftingTable . addShapedMirrored( "recipe_name" , MirrorAxis . DIAGONAL, < item : minecraft:dirt > , [[ < item : minecraft:diamond > ], [ < tag : items:minecraft:wool > ]], (usualOut as IItemStack, inputs as IItemStack [][]) => { if (inputs[ 0 ][ 0 ].displayName == "totally real diamond block" ){ return usualOut;} return < item : minecraft:clay > .setDisplayName( "Diamond" );});
Parameters:
recipeName: string
Type: string
- name of the recipe to add.
// CraftingTableRecipeManager.addShapedPattern(recipeName as string, output as IItemStack, pattern as string[], keys as IIngredient[string], recipeFunction as RecipeFunction2D = null);
craftingTable . addShapedPattern(myString, myIItemStack, myString[], myMap, myRecipeFunction2D);
Parameters:
recipeName: string
Type: string
pattern: string []
Type: string []
// CraftingTableRecipeManager.addShapeless(recipeName as string, output as IItemStack, ingredients as IIngredient[], recipeFunction as RecipeFunction1D = null);
craftingTable . addShapeless(myString, myIItemStack, myIIngredient[], myRecipeFunction1D);
Parameters:
recipeName: string
Type: string
// CraftingTableRecipeManager.allRecipes as List<Recipe>
Return Type:
List <Recipe >
// CraftingTableRecipeManager.allRecipes() as List<Recipe>;
craftingTable . allRecipes();
Return Type:
List <Recipe >
Returns the BEP to get this thingy // CraftingTableRecipeManager.commandString as string
craftingTable . commandString
Return Type:
string
Returns the BEP to get this thingy // CraftingTableRecipeManager.commandString() as string;
craftingTable . commandString();
Return Type:
string
// CraftingTableRecipeManager.getRecipeByName(name as string) as Recipe?;
craftingTable . getRecipeByName(myString);
Parameters:
name: string
Type: string
Return Type:
Recipe ?
// CraftingTableRecipeManager.getRecipesByOutput(output as IIngredient) as List<Recipe>;
craftingTable . getRecipesByOutput(myIIngredient);
Return Type:
List <Recipe >
Returns a map of all known recipes. // CraftingTableRecipeManager.recipeMap as Recipe[ResourceLocation]
Return Type:
Recipe [ResourceLocation ]
Returns a map of all known recipes. Returns : A Map of recipe name to recipe of all known recipes.
// CraftingTableRecipeManager.recipeMap() as Recipe[ResourceLocation];
craftingTable . recipeMap();
Return Type:
Recipe [ResourceLocation ]
Remove a recipe based on it's output. // CraftingTableRecipeManager.remove(output as IIngredient);
craftingTable . remove( < tag : items:minecraft:wool > );
Remove all recipes in this registry // CraftingTableRecipeManager.removeAll();
craftingTable . removeAll();
Removes all recipes where the input contains the given IItemStack. // CraftingTableRecipeManager.removeByInput(input as IItemStack);
craftingTable . removeByInput( < item : minecraft:iron_ingot > );
Remove recipe based on Registry name modid // CraftingTableRecipeManager.removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false);
craftingTable . 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
Remove recipes based on Registry names // CraftingTableRecipeManager.removeByName(names as string[]);
craftingTable . removeByName(myString[]);
Parameters:
names: string []
Type: string []
- registry names of recipes to remove
Remove recipe based on regex with an added exclusion check, so you can remove the whole mod besides a few specified. // CraftingTableRecipeManager.removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false);
craftingTable . 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