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

HarvestEntry

Importing the class

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.

script.zs
import mods.botanypotstweaker.crop.HarvestEntry;

Description

Represents the output of a crop

Members

Getter
Gets the chance for this entry to happen
script.zs
// HarvestEntry.chance as float
myHarvestEntry.chance

Return Type: float

Getter
Gets the item to give.
script.zs
// HarvestEntry.item as IItemStack
myHarvestEntry.item

Return Type: IItemStack

Getter
Gets the highest amount of the item to give.
script.zs
// HarvestEntry.maxRolls as int
myHarvestEntry.maxRolls

Return Type: int

Getter
Gets the lowest amount of the item to give.
script.zs
// HarvestEntry.minRolls as int
myHarvestEntry.minRolls

Return Type: int

static of(chance as float, item as IItemStack, minRolls as int = 1, maxRolls as int = 1) as HarvestEntry
Creates a new HarvestEntry.

Returns: a new harvest entry with the given values.

script.zs
// HarvestEntry.of(chance as float, item as IItemStack, minRolls as int = 1, maxRolls as int = 1) as HarvestEntry;
HarvestEntry.of(myFloat, myIItemStack, myInt, myInt);

Parameters:

chance Type: float - The chance for this entry to happen.
item Type: IItemStack - The item to give when harvested.
minRolls (optional) Type: int - The lowest amount of the item to give.

Default Value: 1

maxRolls (optional) Type: int - The maximum amount of the item to give.

Default Value: 1

Return Type: HarvestEntry