Class EntityChunky
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
public class EntityChunky : Entity
- Inheritance
-
EntityChunky
- Inherited Members
- Extension Methods
Constructors
EntityChunky()
public EntityChunky()
Fields
blocks
protected IMiniDimension blocks
Field Value
subDimensionIndex
Used to map chunks from load/save game and server-client packets to this specific entity. The position of saved chunks will include a reference to this index
protected int subDimensionIndex
Field Value
Properties
ApplyGravity
If gravity should applied to this entity
public override bool ApplyGravity { get; }
Property Value
IsInteractable
Whether or not the EntityChunky is interactable.
public override bool IsInteractable { get; }
Property Value
SwimmingOffsetY
Used for passive physics simulation, together with the MaterialDensity to check how deep in the water the entity should float
public override double SwimmingOffsetY { get; }
Property Value
Methods
AssociateWithDimension(IMiniDimension)
public void AssociateWithDimension(IMiniDimension blocks)
Parameters
blocks
IMiniDimension
CreateAndLinkWithDimension(ICoreServerAPI, IMiniDimension)
public static EntityChunky CreateAndLinkWithDimension(ICoreServerAPI sapi, IMiniDimension dimension)
Parameters
sapi
ICoreServerAPIdimension
IMiniDimension
Returns
Die(EnumDespawnReason, DamageSource)
Makes the entity despawn. Entities only drop something on EnumDespawnReason.Death
public override void Die(EnumDespawnReason reason = EnumDespawnReason.Death, DamageSource damageSourceForDeath = null)
Parameters
reason
EnumDespawnReasondamageSourceForDeath
DamageSource
FromBytes(BinaryReader, bool)
Loads the entity from a stored byte array from the SaveGame
public override void FromBytes(BinaryReader reader, bool forClient)
Parameters
reader
BinaryReaderforClient
bool
Initialize(EntityProperties, ICoreAPI, long)
Called when this entity got created or loaded
public override void Initialize(EntityProperties properties, ICoreAPI api, long chunkindex3d)
Parameters
properties
EntityPropertiesapi
ICoreAPIchunkindex3d
long
OnCollideWithLiquid()
Called when the entity got in touch with a liquid
public override void OnCollideWithLiquid()
OnEntityDespawn(EntityDespawnData)
Called when the entity despawns
public override void OnEntityDespawn(EntityDespawnData despawn)
Parameters
despawn
EntityDespawnData
OnGameTick(float)
Called every 1/75 second
public override void OnGameTick(float dt)
Parameters
dt
float
OnReceivedServerAnimations(int[], int, float[])
public override void OnReceivedServerAnimations(int[] activeAnimations, int activeAnimationsCount, float[] activeAnimationSpeeds)
Parameters
OnReceivedServerPos(bool)
Called by client when a new server pos arrived
public override void OnReceivedServerPos(bool isTeleport)
Parameters
isTeleport
bool
ReceiveDamage(DamageSource, float)
Called when the entity should be receiving damage from given source
public override bool ReceiveDamage(DamageSource damageSource, float damage)
Parameters
damageSource
DamageSourcedamage
float
Returns
- bool
True if the entity actually received damage
ShouldReceiveDamage(DamageSource, float)
Should return true if the entity can get damaged by given damageSource. Is called by ReceiveDamage.
public override bool ShouldReceiveDamage(DamageSource damageSource, float damage)
Parameters
damageSource
DamageSourcedamage
float
Returns
StartAnimation(string)
Starts the animation for the entity.
public override void StartAnimation(string code)
Parameters
code
string
StopAnimation(string)
stops the animation for the entity.
public override void StopAnimation(string code)
Parameters
code
string
UpdateDebugAttributes()
Updates the DebugAttributes tree
public override void UpdateDebugAttributes()