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.
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
// ICookingRecipeManager<T : AbstractCookingRecipe>.addJsonRecipe(name as string, mapData as MapData);
addRecipe(name as string, output as IItemStack, input as IIngredient, xp as float, cookTime as int)
Adds a recipe based on given params. Note: A cookTime of 0 will cause the recipe to never complete, it will burn and use fuel, but no progress will be made on the recipe, it needs to be at-least 1 or more. Saying that, if you would like to make a recipe that will never complete (for example being able to give the player an infinitely burning furnace for whatever reason), you can still use a cookTime of 0.
script.zs
// ICookingRecipeManager<T : AbstractCookingRecipe>.addRecipe(name as string, output as IItemStack, input as IIngredient, xp as float, cookTime as int);
xp: floatType: float
- how much xp the player gets
cookTime: intType: int
- how long it takes to cook
addRecipe(name as string, category as CookingBookCategory, output as IItemStack, input as IIngredient, xp as float, cookTime as int)
Adds a recipe based on given params. Note: A cookTime of 0 will cause the recipe to never complete, it will burn and use fuel, but no progress will be made on the recipe, it needs to be at-least 1 or more. Saying that, if you would like to make a recipe that will never complete (for example being able to give the player an infinitely burning furnace for whatever reason), you can still use a cookTime of 0.
script.zs
// ICookingRecipeManager<T : AbstractCookingRecipe>.addRecipe(name as string, category as CookingBookCategory, output as IItemStack, input as IIngredient, xp as float, cookTime as int);
removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false)
Remove recipe based on Registry name modid
script.zs
// ICookingRecipeManager<T : AbstractCookingRecipe>.removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false);
furnace.removeByModid("minecraft", myPredicate);
Parameters:
modid: stringType: string
- modid of the recipes to remove
exclude: function(t as string) as bool(optional) Type: function(t as string) as bool
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
// ICookingRecipeManager<T : AbstractCookingRecipe>.removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false);
furnace.removeByRegex("\\d_\\d", (name asstring) => {return name == "orange_wool";});
Parameters:
regex: stringType: string
- regex to match against
exclude: function(t as string) as bool(optional) Type: function(t as string) as bool