Table of Contents

Class EntityType

Namespace
Vintagestory.ServerMods.NoObf
Assembly
VSEssentials.dll

An entity type. Any json files inside of assets/entities will be loaded in as this type. Open in GitHub

[DocumentAsJson]
[JsonObject(MemberSerialization.OptIn)]
public class EntityType : RegistryObjectType
Inheritance
EntityType
Inherited Members

Fields

Client (Required)

The client-side properties of the entity. Usually related to rendering, precise physics calculations, and behaviors.

[JsonProperty]
public ClientEntityConfig Client

Field Value

ClientEntityConfig

Server (Required)

The server-side properties of the entity. Usually related to spawning, general physics, AI tasks, and other behaviors..

[JsonProperty]
public ServerEntityConfig Server

Field Value

ServerEntityConfig

Sounds (Recommended) (Default: None)

The sounds that this entity can make. Keys to use are:

  • "hurt"
  • "death"
  • "idle"
  • "swim" (player only)
  • "eat" (player only)
[JsonProperty]
public Dictionary<string, AssetLocation> Sounds

Field Value

Dictionary<string, AssetLocation>

Attributes (Optional) (Default: None)

Specific attributes for the entity. Contents can vary per entity.

[JsonProperty]
[JsonConverter(typeof(JsonAttributesConverter))]
public JsonObject Attributes

Field Value

JsonObject

BehaviorConfigs (Optional) (Default: None)

A list of properties common to each client/server entity behavior. Key is a behavior code, and value is a set of attributes. Attributes will get merged with any matching client/server entity behaviors.

[JsonProperty(ItemConverterType = typeof(JsonAttributesConverter))]
public Dictionary<string, JsonObject> BehaviorConfigs

Field Value

Dictionary<string, JsonObject>

CanClimb (Optional) (Default: false)

If true the entity can climb on walls.

[JsonProperty]
public bool CanClimb

Field Value

bool

CanClimbAnywhere (Optional) (Default: false)

If true the entity can climb anywhere.

[JsonProperty]
public bool CanClimbAnywhere

Field Value

bool

ClimbTouchDistance (Optional) (Default: 0.5)

The minimum distance from a block that a creature has to be to climb it.

[JsonProperty]
public float ClimbTouchDistance

Field Value

float

CollisionBoxSize (Optional) (Default: 0.5, 0.5)

The size of the entity's hitbox, in meters.

[JsonProperty]
public Vec2f CollisionBoxSize

Field Value

Vec2f

DeadCollisionBoxSize (Optional) (Default: 0.5, 0.25)

The size of the hitbox, in meters, while the entity is dead.

[JsonProperty]
public Vec2f DeadCollisionBoxSize

Field Value

Vec2f

DeadHitBoxSize (Optional)

[JsonProperty]
public Vec2f DeadHitBoxSize { get; set; }

Field Value

Vec2f

DeadSelectionBoxSize (Optional) (Default: DeadCollisionBoxSize)

The size of the hitbox while the entity is dead. Defaults to DeadCollisionBoxSize.

[JsonProperty]
public Vec2f DeadSelectionBoxSize

Field Value

Vec2f

Drops (Optional) (Default: None)

The drops for the entity when they are killed.

[JsonProperty]
public BlockDropItemStack[] Drops

Field Value

BlockDropItemStack[]

EyeHeight (Optional) (Default: 0.1)

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

[JsonProperty]
public double EyeHeight

Field Value

double

FallDamageMultiplier (Optional) (Default: 1)

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

[JsonProperty]
public float FallDamageMultiplier

Field Value

float

Habitat (Optional) (Default: Land)

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

[JsonProperty]
public EnumHabitat Habitat

Field Value

EnumHabitat

HitBoxSize (Optional)

[JsonProperty]
public Vec2f HitBoxSize { get; set; }

Field Value

Vec2f

IdleSoundChance (Optional) (Default: 0.3)

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

[JsonProperty]
public float IdleSoundChance

Field Value

float

IdleSoundRange (Optional) (Default: 24)

The sound range for the idle sound in blocks.

[JsonProperty]
public float IdleSoundRange

Field Value

float

KnockbackResistance (Optional) (Default: 0)

The resistance to being pushed back by an impact. Value will vary based on mob weight.

[JsonProperty]
public float KnockbackResistance

Field Value

float

RotateModelOnClimb (Optional) (Default: false)

Should the entity rotate to 'stand' on the direction it's climbing?

[JsonProperty]
public bool RotateModelOnClimb

Field Value

bool

SelectionBoxSize (Optional) (Default: CollisionBoxSize)

The size of the entity's hitbox. Defaults to CollisionBoxSize.

[JsonProperty]
public Vec2f SelectionBoxSize

Field Value

Vec2f

SwimmingEyeHeight (Optional) (Default: EyeHeight)

The eye height of the entity when swimming. Defaults to be same as EyeHeight.

[JsonProperty]
public double? SwimmingEyeHeight

Field Value

double?

Weight (Optional) (Default: 25)

The mass of this type of entity in kilograms, on average.

[JsonProperty]
public float Weight

Field Value

float