Home Commands Examples Getting Started With Scripts Global Keywords
Generic Recipe Manipulation

CookingPot

Farmer’s Delight Cooking Pot recipes.

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import mods.farmersdelight.CookingPot;

Implemented Interfaces

CookingPot implements the following interfaces. That means all methods defined in these interfaces are also available in CookingPot

Methods

script.zs
CookingPot.addJsonRecipe(name as string, mapData as MapData)
ParameterType
Parameter
name
Type
string
Parameter
mapData
Type
MapData

Add a cooking pot recipe. The Cooking Tab is optional.

script.zs
// CookingPot.addRecipe(name as string, output as IItemStack, inputs as IIngredient[], cookingPotRecipeBookTab as CookingPotRecipeBookTab, container as IItemStack, experience as float, cookTime as int)
<recipetype:farmersdelight:cooking>.addRecipe("cooking_pot_test", <item:minecraft:enchanted_golden_apple>, [<item:minecraft:gold_block>], <constant:farmersdelight:cooking_pot_recipe_book_tab:misc>, <item:minecraft:apple>, 100, 400);
ParameterTypeDescriptionOptionalDefault Value
Parameter
name
Type
string
Description
Name of the recipe to add
Optional
false
Default Value
Parameter
output
Type
IItemStack
Description
Output item
Optional
false
Default Value
Parameter
inputs
Type
IIngredient[]
Description
Input ingredients
Optional
false
Default Value
Parameter
cookingPotRecipeBookTab
Type
CookingPotRecipeBookTab
Description
Optional
true
Default Value
Parameter
container
Type
IItemStack
Description
Container item
Optional
true
Default Value
Parameter
experience
Type
float
Description
Experience granted
Optional
true
Default Value
0.0
Parameter
cookTime
Type
int
Description
Cooking time
Optional
true
Default Value
200

Return Type: stdlib.List<T>

script.zs
// CookingPot.getAllRecipes() as stdlib.List<T>
<recipetype:farmersdelight:cooking>.getAllRecipes();

Return Type: T

script.zs
CookingPot.getRecipeByName(name as string) as T
ParameterType
Parameter
name
Type
string

Return Type: T[ResourceLocation]

script.zs
// CookingPot.getRecipeMap() as T[ResourceLocation]
<recipetype:farmersdelight:cooking>.getRecipeMap();

Return Type: stdlib.List<T>

script.zs
CookingPot.getRecipesByOutput(output as IIngredient) as stdlib.List<T>
ParameterType
Parameter
output
Type
IIngredient
script.zs
CookingPot.remove(output as IIngredient)
ParameterType
Parameter
output
Type
IIngredient
script.zs
// CookingPot.removeAll()
<recipetype:farmersdelight:cooking>.removeAll();
script.zs
CookingPot.removeByInput(input as IItemStack)
ParameterType
Parameter
input
Type
IItemStack
script.zs
CookingPot.removeByModid(modid as string, exclude as Predicate<string>)
ParameterTypeOptionalDefault Value
Parameter
modid
Type
string
Optional
false
Default Value
Parameter
exclude
Type
Predicate<string>
Optional
true
Default Value
(name as string) as bool => false
script.zs
CookingPot.removeByName(names as string[])
ParameterType
Parameter
names
Type
string[]
script.zs
CookingPot.removeByRegex(regex as string, exclude as Predicate<string>)
ParameterTypeOptionalDefault Value
Parameter
regex
Type
string
Optional
false
Default Value
Parameter
exclude
Type
Predicate<string>
Optional
true
Default Value
(name as string) as bool => false

Properties

NameTypeHas GetterHas Setter
Name
allRecipes
Type
stdlib.List<T>
Has Getter
true
Has Setter
false
Name
recipeMap
Type
T[ResourceLocation]
Has Getter
true
Has Setter
false