Table of Contents

Class EntityStats

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public class EntityStats : IEnumerable<KeyValuePair<string, EntityFloatStats>>, IEnumerable
Inheritance
EntityStats
Implements
Inherited Members
Extension Methods

Constructors

EntityStats(Entity)

public EntityStats(Entity entity)

Parameters

entity Entity

Properties

this[string]

public EntityFloatStats this[string key] { get; set; }

Parameters

key string

Property Value

EntityFloatStats

Methods

FromTreeAttributes(ITreeAttribute)

public void FromTreeAttributes(ITreeAttribute tree)

Parameters

tree ITreeAttribute

GetBlended(string)

Get the final stat value, blended by the stats blend type

public float GetBlended(string category)

Parameters

category string

Returns

float

GetEnumerator()

public IEnumerator<KeyValuePair<string, EntityFloatStats>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<string, EntityFloatStats>>

Register(string, EnumStatBlendType)

Set up a stat. Its not required to call this method, you can go straight to doing .Set() if your blend type is weighted sum. Also initializes a base value of 1.

public EntityStats Register(string category, EnumStatBlendType blendType = EnumStatBlendType.WeightedSum)

Parameters

category string
blendType EnumStatBlendType

Returns

EntityStats

Remove(string, string)

Remove a stat value

public EntityStats Remove(string category, string code)

Parameters

category string
code string

Returns

EntityStats

Set(string, string, float, bool)

Set a stat value, if the stat catgory does not exist, it will create a new default one. Initializes a base value of 1 when creating a new stat.

public EntityStats Set(string category, string code, float value, bool persistent = false)

Parameters

category string
code string
value float
persistent bool

Returns

EntityStats

ToTreeAttributes(ITreeAttribute, bool)

public void ToTreeAttributes(ITreeAttribute tree, bool forClient)

Parameters

tree ITreeAttribute
forClient bool