Table of Contents

Class CropBehavior

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public abstract class CropBehavior
Inheritance
CropBehavior
Inherited Members
Extension Methods

Constructors

CropBehavior(Block)

public CropBehavior(Block block)

Parameters

block Block

Fields

block

public Block block

Field Value

Block

Methods

Initialize(JsonObject)

Initializes the crop with additional properties.

public virtual void Initialize(JsonObject properties)

Parameters

properties JsonObject

OnPlanted(ICoreAPI)

The event fired when the crop is planted.

public virtual void OnPlanted(ICoreAPI api)

Parameters

api ICoreAPI

The core API.

TryGrowCrop(ICoreAPI, IFarmlandBlockEntity, double, int, ref EnumHandling)

Attempts to grow the crop.

public virtual bool TryGrowCrop(ICoreAPI api, IFarmlandBlockEntity farmland, double currentTotalHours, int newGrowthStage, ref EnumHandling handling)

Parameters

api ICoreAPI

The Core API

farmland IFarmlandBlockEntity

The farmland below the crop.

currentTotalHours double
newGrowthStage int

The next growth stage.

handling EnumHandling

Whether or not this event was handled.

Returns

bool

Whether or not the crop grew.