Table of Contents

Class EntityBehaviorBreathe

Namespace
Vintagestory.GameContent
Assembly
VSEssentials.dll

Makes entity receive damage from suffocation upon depleting its oxygen.
Uses the "breathe" code Open in GitHub

[DocumentAsJson]
[AddDocumentationProperty("asphyxiating", "Use this attribute on a block. Should an entity suffocate if inside of this block?", "System.Boolean", "Optional", "True", true)]
public class EntityBehaviorBreathe : EntityBehavior
Inheritance
EntityBehaviorBreathe

Examples

"behaviors": [
 {
     "code": "breathe",
     "maxoxygen": 40000,
     "currentoxygen": 40000
 },
],

Fields

CurrentOxygen (Optional) (Default: MaxOxygen)

The entity will have this much oxygen level (in milliseconds) upon spawn if this is set in JSON. Otherwise, this is the current oxygen level of the entity

[DocumentAsJson("Optional", "MaxOxygen", false)]
public float Oxygen { get; set; }

Field Value

float

MaxOxygen (Optional) (Default: 40000)

The maximum oxygen level the entity can have (in milliseconds)

[DocumentAsJson("Optional", "40000", false)]
public float MaxOxygen { get; set; }

Field Value

float

Properties

asphyxiating (Optional) (Default: True)

Use this attribute on a block. Should an entity suffocate if inside of this block?

Property Value

Boolean