Table of Contents

Class EntityBehaviorHarvestable

Namespace
Vintagestory.GameContent
Assembly
VSEssentials.dll

Makes entity harvestable upon its death.
Uses the "harvestable" code Open in GitHub

[DocumentAsJson]
[AddDocumentationProperty("deathByMultiplier", "If an entity is killed by the entity with this attribute, what multiple of drops should this creature yield?", "System.Single", "Optional", "0.4", true)]
[AddDocumentationProperty("isMechanical", "If false, drop rates will be affected by \"animalLootDropRate\" character's trait", "System.Boolean", "Optional", "false", true)]
[AddDocumentationProperty("killedByInfoText", "If used on the entity that kills this one, this will replace the \"killed by\" text with a specified lang file entry.", "System.String", "Optional", "deadcreature-killed", true)]
[AddDocumentationProperty("quantitySlots", "Limits how many item stacks in total can be obtained per single harvest", "System.Int32", "Optional", "4", false)]
public class EntityBehaviorHarvestable : EntityBehaviorContainer
Inheritance
EntityBehaviorHarvestable
Inherited Members

Examples

"behaviors": [
 {
     "code": "harvestable",
     "quantitySlots": 4,
     "duration": 2,
     "fixedweight": true,
     "drops": [
         {
             "type": "item",
             "code": "gear-temporal",
             "quantity": { "avg": 0.02666, "var": 0 }
         },
         {
             "type": "item",
             "code": "flaxfibers",
             "quantity": { "avg": 0.2, "var": 0 }
         },
         {
             "type": "item",
             "code": "gear-rusty",
             "dropModbyStat": "rustyGearDropRate",
             "quantity": { "avg": 0.01, "var": 0 }
         }
     ]
 },
],
...
"attributes": {
  "deathByMultiplier": 0,
  "isMechanical": false,
  "killedByInfoText": "deadcreature-killed"
}

Fields

drops (Required)

The items obtained upon harvesting. Entity drops are merged with these ones

[DocumentAsJson("Required", "", false)]
protected BlockDropItemStack[] jsonDrops

Field Value

BlockDropItemStack[]

duration (Optional) (Default: 5)

How long it takes to harvest the creature

[DocumentAsJson("Optional", "5", false)]
private float baseHarvestDuration

Field Value

float

fixedWeight (Optional) (Default: False)

Whether the creature has a fixed weight. If false, drop rate will be affected by the current weight of the creature

[DocumentAsJson("Optional", "False", false)]
private bool fixedWeight

Field Value

bool

quantitySlots (Optional) (Default: 4)

Limits how many item stacks in total can be obtained per single harvest

Field Value

Int32

Properties

deathByMultiplier (Optional) (Default: 0.4)

If an entity is killed by the entity with this attribute, what multiple of drops should this creature yield?

Property Value

float

isMechanical (Optional) (Default: false)

If false, drop rates will be affected by "animalLootDropRate" character's trait

Property Value

bool

killedByInfoText (Optional) (Default: deadcreature-killed)

If used on the entity that kills this one, this will replace the "killed by" text with a specified lang file entry.

Property Value

String