Table of Contents

Class EntityProperties

Namespace
Vintagestory.API.Common.Entities
Assembly
VintagestoryAPI.dll
public class EntityProperties
Inheritance
EntityProperties
Inherited Members

Fields

Attributes

The attributes of the entity. These are the Attributes read from the entity type's JSON file.
If your code modifies these Attributes (not recommended!), the changes will apply to all entities of the same type.

public JsonObject Attributes

Field Value

JsonObject

CanClimb

If true the entity can climb on walls

public bool CanClimb

Field Value

bool

CanClimbAnywhere

If true the entity can climb anywhere.

public bool CanClimbAnywhere

Field Value

bool

Class

The classification of the entity.

public string Class

Field Value

string

Client

The client properties of the entity.

public EntityClientProperties Client

Field Value

EntityClientProperties

ClimbTouchDistance

public float ClimbTouchDistance

Field Value

float

Code

The entity code in the code.

public AssetLocation Code

Field Value

AssetLocation

CollisionBoxSize

The size of the entity's hitbox (default: 0.2f/0.2f)

public Vec2f CollisionBoxSize

Field Value

Vec2f

Color

public string Color

Field Value

string

DeadCollisionBoxSize

The size of the hitbox while the entity is dead.

public Vec2f DeadCollisionBoxSize

Field Value

Vec2f

DeadSelectionBoxSize

The size of the hitbox while the entity is dead. (default: null, i.e. same as dead collision box)

public Vec2f DeadSelectionBoxSize

Field Value

Vec2f

Drops

The drops for the entity when they are killed.

public BlockDropItemStack[] Drops

Field Value

BlockDropItemStack[]

DropsPacket

public byte[] DropsPacket

Field Value

byte[]

EyeHeight

How high the camera should be placed if this entity were to be controlled by the player

public double EyeHeight

Field Value

double

FallDamage

Whether the entity should take fall damage

public bool FallDamage

Field Value

bool

FallDamageMultiplier

If less than one, mitigates fall damage (e.g. could be used for mountainous creatures); if more than one, increases fall damage (e.g fragile creatures?)

public float FallDamageMultiplier

Field Value

float

Habitat

Natural habitat of the entity. Decides whether to apply gravity or not

public EnumHabitat Habitat

Field Value

EnumHabitat

Id

Assigned on registering the entity type

public int Id

Field Value

int

IdleSoundChance

The chance that an idle sound will play for the entity.

public float IdleSoundChance

Field Value

float

IdleSoundRange

The sound range for the idle sound in blocks.

public float IdleSoundRange

Field Value

float

KnockbackResistance

The resistance to being pushed back by an impact.

public float KnockbackResistance

Field Value

float

ResolvedSounds

The sounds this entity can make after being resolved.

public Dictionary<string, AssetLocation[]> ResolvedSounds

Field Value

Dictionary<string, AssetLocation[]>

RotateModelOnClimb

Should the model in question rotate if climbing?

public bool RotateModelOnClimb

Field Value

bool

SelectionBoxSize

The size of the entity's hitbox (default: null, i.e. same as collision box)

public Vec2f SelectionBoxSize

Field Value

Vec2f

Server

The server properties of the entity.

public EntityServerProperties Server

Field Value

EntityServerProperties

Sounds

The sounds that this entity can make.

public Dictionary<string, AssetLocation> Sounds

Field Value

Dictionary<string, AssetLocation>

SwimmingEyeHeight

public double SwimmingEyeHeight

Field Value

double

Variant

Variant values as resolved from blocktype/itemtype or entitytype

public OrderedDictionary<string, string> Variant

Field Value

OrderedDictionary<string, string>

Weight

The mass of this type of entity in kilograms, on average - defaults to 25kg (medium-low) if not set by the asset

public float Weight

Field Value

float

Properties

SpawnCollisionBox

The collision box they have.

public Cuboidf SpawnCollisionBox { get; }

Property Value

Cuboidf

Methods

Clone()

Creates a copy of this object.

public EntityProperties Clone()

Returns

EntityProperties

InitSounds(IAssetManager)

Initializes the sounds for this entity type.

public void InitSounds(IAssetManager assetManager)

Parameters

assetManager IAssetManager

Initialize(Entity, ICoreAPI)

Initalizes the properties for the entity.

public void Initialize(Entity entity, ICoreAPI api)

Parameters

entity Entity

the entity to tie this to.

api ICoreAPI

The Core API