Class EntityBehaviorDespawn
- Namespace
- Vintagestory.GameContent
- Assembly
- VSEssentials.dll
Despawns entity on certain conditions
Uses the "despawn" code. Open in GitHub
[DocumentAsJson]
[AddDocumentationProperty("afterDays", "How many in-game days should pass before the entity can despawn", "System.Single", "Optional", "14", false)]
public class EntityBehaviorDespawn : EntityBehavior
- Inheritance
-
EntityBehaviorDespawn
Examples
"behaviors": [
{
"code": "despawn",
"minPlayerDistance": 16,
"belowLightLevel": 8,
"minSeconds": 300,
"afterDays": 14
}
],
Fields
afterDays (Optional) (Default: 14)
How many in-game days should pass before the entity can despawn
Field Value
belowLightLevel (Optional) (Default: -1)
Despawns the entity only below specified light level. Ignored when set to -1
[DocumentAsJson("Optional", "-1", false)]
private float belowLightLevel
Field Value
minPlayerDistance (Optional) (Default: -1)
Determines the minimal distance the entity should be from nearest player before it can despawn. Ignored when set to -1
[DocumentAsJson("Optional", "-1", false)]
private float minPlayerDistance
Field Value
minSeconds (Optional) (Default: 30)
How many real time seconds should pass before the entity can despawn
[DocumentAsJson("Optional", "30", false)]
private float minSeconds