Home Commands Examples Getting Started With Scripts Global Keywords
Generic JSON Recipes

Grinder

Contrary to what this file indicates, the mod adding support to the Grinder is Better Grinder, not PlainGrinder.

The mod can be found here

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.plaingrinder.Grinder;

Implemented Interfaces

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

Methods

script.zs
Grinder.addJsonRecipe(name as string, mapData as MapData)
ParameterType
Parameter
name
Type
string
Parameter
mapData
Type
MapData
script.zs
// Grinder.addRecipe(name as string, input as IIngredient[], result as IItemStack, firstChance as float, optional as IItemStack, optionalChance as float)
<recipetype:plaingrinder:grinder>.addRecipe("recipe_name_as_string",, [<item:minecraft:wooden_axe>], <item:minecraft:clock> * 2, 1.0, <item:minecraft:powered_rail>, 0.5);
ParameterTypeDescriptionOptionalDefault Value
Parameter
name
Type
string
Description
The unique name of the recipe to add
Optional
false
Default Value
Parameter
input
Type
IIngredient[]
Description
The inputs to consume
Optional
false
Default Value
Parameter
result
Type
IItemStack
Description
The primary result to output
Optional
false
Default Value
Parameter
firstChance
Type
float
Description
The chance of the result to appear
Optional
true
Default Value
1.0
Parameter
optional
Type
IItemStack
Description
An optional secondary item to output
Optional
true
Default Value
Parameter
optionalChance
Type
float
Description
The chance of the secondary result
Optional
true
Default Value
0.0

Return Type: stdlib.List<T>

script.zs
// Grinder.getAllRecipes() as stdlib.List<T>
<recipetype:plaingrinder:grinder>.getAllRecipes();

Return Type: T

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

Return Type: T[ResourceLocation]

script.zs
// Grinder.getRecipeMap() as T[ResourceLocation]
<recipetype:plaingrinder:grinder>.getRecipeMap();

Return Type: stdlib.List<T>

script.zs
Grinder.getRecipesByOutput(output as IIngredient) as stdlib.List<T>
ParameterType
Parameter
output
Type
IIngredient
script.zs
Grinder.remove(output as IIngredient)
ParameterType
Parameter
output
Type
IIngredient
script.zs
// Grinder.removeAll()
<recipetype:plaingrinder:grinder>.removeAll();
script.zs
Grinder.removeByInput(input as IItemStack)
ParameterType
Parameter
input
Type
IItemStack
script.zs
Grinder.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
Grinder.removeByName(name as string)
ParameterType
Parameter
name
Type
string
script.zs
Grinder.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