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
- blockBlock
Fields
block
public Block blockField Value
Methods
Initialize(JsonObject)
Initializes the crop with additional properties.
public virtual void Initialize(JsonObject properties)Parameters
- propertiesJsonObject
OnPlanted(ICoreAPI, ItemSlot, EntityAgent, BlockSelection)
The event fired when the crop is planted.
public virtual void OnPlanted(ICoreAPI api, ItemSlot itemslot, EntityAgent byEntity, BlockSelection blockSel)Parameters
- apiICoreAPI
- The core API. 
- itemslotItemSlot
- The itemslot that the plant was planted with. 
- byEntityEntityAgent
- The entity that planted the plant. 
- blockSelBlockSelection
- The block selection used when the seed was planted. 
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
- apiICoreAPI
- The Core API 
- farmlandIFarmlandBlockEntity
- The farmland below the crop. 
- currentTotalHoursdouble
- newGrowthStageint
- The next growth stage. 
- handlingEnumHandling
- Whether or not this event was handled. 
Returns
- bool
- Whether or not the crop grew.