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.
Add a new recipe based on the given recipe in a valid DataPack JSON format. Unlike the addJSONRecipe method in IRecipeManager you **must** set the type of the recipe within the JSON yourself.
script.zs
// GenericRecipesManager.addJsonRecipe(name as string, data as MapData);
recipes.addJsonRecipe("recipe_name", {
type: "minecraft:smoking",
ingredient: <item:minecraft:gold_ore>,
result: <item:minecraft:cooked_porkchop>,
experience: 0.35asfloat,
cookingtime: 100
});
Parameters:
name: stringType: string
- The recipe's resource path
Returns a list of all known recipe managers. This includes managers added by mod integrations as well as wrapper managers added to provide simple support.
script.zs
// GenericRecipesManager.allManagers as List<IRecipeManager<?>>
Returns a list of all known recipe managers. This includes managers added by mod integrations as well as wrapper managers added to provide simple support.
script.zs
// GenericRecipesManager.allManagers() as List<IRecipeManager<?>>;
Removes all recipes from the provided mod. Chooses the recipes based on their full recipe name, not based on output item!
script.zs
// GenericRecipesManager.removeByModid(modId as string);
recipes.removeByModid("crafttweaker");
Parameters:
modId: stringType: string
- The mod's modId
removeByModid(modId as string, exclude as function(t as string) as bool)
Removes all recipes from the provided mod. Allows a function to exclude certain recipe names from being removed. In the example below, only the recipe for the white bed would remain. Since the recipe's namespace is already fixed based on the modId argument, the recipe filter will only check the resource path!
script.zs
// GenericRecipesManager.removeByModid(modId as string, exclude as function(t as string) as bool);