Class BlockBehaviorHarvestable
- Namespace
- Vintagestory.GameContent
- Assembly
- VSSurvivalMod.dll
Allows a block to be harvested with the right mouse button for set items. Uses the code "harvestable".
[DocumentAsJson]
[AddDocumentationProperty("ForageStatAffected", "Should the harvested stack amount be multiplied by the player's 'forageDropRate' stat?", "System.Boolean", "Optional", "False", true)]
public class BlockBehaviorHarvestable : BlockBehavior
- Inheritance
-
BlockBehaviorHarvestable
Examples
"behaviorsByType": {
"*-ripe": [
{
"name": "Harvestable",
"properties": {
"harvestTime": 0.6,
"harvestedStack": {
"type": "item",
"code": "fruit-{type}",
"quantity": { "avg": 4.4 }
},
"harvestedBlockCode": "bigberrybush-{type}-empty",
"exchangeBlock": true
}
}
]
}
...
"attributes": {
"forageStatAffected": true
}
Fields
harvestedStack (Required)
A drop for when the block is harvested. If using more than a single drop, use harvestedStacks, otherwise this property is required.
[DocumentAsJson("Required", "", false)]
public BlockDropItemStack harvestedStack { get; set; }
Field Value
harvestedStacks (Required)
An array of drops for when the block is harvested. If only using a single drop you can use harvestedStack, otherwise this property is required.
[DocumentAsJson("Required", "", false)]
public BlockDropItemStack[] harvestedStacks
Field Value
harvestTime (Recommended) (Default: 0)
The amount of time, in seconds, it takes to harvest this block.
[DocumentAsJson("Recommended", "0", false)]
private float harvestTime
Field Value
exchangeBlock (Optional) (Default: False)
Should this block be exchanged (true) or replaced (false)? If true, then any block entity at the same position will not be deleted.
[DocumentAsJson("Optional", "False", false)]
private bool exchangeBlock
Field Value
harvestedBlockCode (Optional) (Default: None)
The block to replace this one after it is harvested.
[DocumentAsJson("Optional", "None", false)]
private AssetLocation harvestedBlockCode
Field Value
harvestingSound (Optional) (Default: sounds/block/leafy-picking)
The sound to play whilst the object is being harvested.
[DocumentAsJson("Optional", "sounds/block/leafy-picking", false)]
public AssetLocation harvestingSound
Field Value
Properties
ForageStatAffected (Optional) (Default: False)
Should the harvested stack amount be multiplied by the player's 'forageDropRate' stat?