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

BasicCrop

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.BasicCrop;

Description

A basic definition of a crop.

Extends

BasicCrop extends Crop.

Implements

BasicCrop implements the following interfaces:

Recipe<Container>

Members

Getter
Gets how the display states of the crop
script.zs
// BasicCrop.displayStates as DisplayState[]
myBasicCrop.displayStates

Return Type: DisplayState[]

Getter
Gets the amount of ticks for the crop to grow.
script.zs
// BasicCrop.growthTicks as int
myBasicCrop.growthTicks

Return Type: int

Getter
Gets the light level of the crop.
script.zs
// BasicCrop.lightLevel as int
myBasicCrop.lightLevel

Return Type: int

static of(id as ResourceLocation, seed as IIngredient, soilCategories as List<string>, growthTicks as int, results as HarvestEntry[], displayStates as DisplayState[], lightLevel as int = 0) as BasicCrop
Creates a new BasicCrop
script.zs
// BasicCrop.of(id as ResourceLocation, seed as IIngredient, soilCategories as List<string>, growthTicks as int, results as HarvestEntry[], displayStates as DisplayState[], lightLevel as int = 0) as BasicCrop;
BasicCrop.of(<resource:crafttweaker:soil_test>, <item:minecraft:diamond>, ["category1"], 200, [HarvestResult.of(0.75, <item:minecraft:apple>)], [<blockstate:minecraft:dirt>], 1);

Parameters:

id Type: ResourceLocation - The ID of the crop.
seed Type: IIngredient - The seed ingredient.
soilCategories Type: List<string> - The list of soil categories.
growthTicks Type: int - The number of growth ticks.
results Type: HarvestEntry[] - The array of harvest entries.
displayStates Type: DisplayState[] - The array of display states for the crop.
lightLevel (optional) Type: int - The optional light level that the crop will give off. Defaults to 0

Default Value: 0

Return Type: BasicCrop

Getter
Gets what this crop will grow.
script.zs
// BasicCrop.results as HarvestEntry[]
myBasicCrop.results

Return Type: HarvestEntry[]

Getter
Gets the ingredient that is used as the seed for the crop.
script.zs
// BasicCrop.seed as IIngredient
myBasicCrop.seed

Return Type: IIngredient

Getter
Gets the soil categories that the crop can grow on.
script.zs
// BasicCrop.soilCategories as List<string>
myBasicCrop.soilCategories

Return Type: List<string>