Class DamageSource
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
public class DamageSource
- Inheritance
-
DamageSource
- Inherited Members
- Extension Methods
Fields
CauseEntity
The entity that caused this damage, e.g. the entity that threw the SourceEntity projectile, if any
public Entity CauseEntity
Field Value
DamageTier
Tier of the weapon used to damage the entity, if any
public int DamageTier
Field Value
HitPosition
The relative hit position of where the damage occured.
public Vec3d HitPosition
Field Value
KnockbackStrength
The amount of knockback this damage will incur
public float KnockbackStrength
Field Value
Source
The type of source the damage came from.
public EnumDamageSource Source
Field Value
SourceBlock
The source block the damage came from, if any
public Block SourceBlock
Field Value
SourceEntity
The source entity the damage came from, if any
public Entity SourceEntity
Field Value
SourcePos
the location of the damage source.
public Vec3d SourcePos
Field Value
Type
The type of damage that was taken.
public EnumDamageType Type
Field Value
Methods
GetCauseEntity()
Get the entity that caused the damage. If a projectile like a stone was thrown this will return the entity that threw the stone instead of the stone.
public Entity GetCauseEntity()
Returns
- Entity
The entity that caused the damage
GetSourcePosition()
Fetches the location of the damage source from either SourcePos or SourceEntity
public Vec3d GetSourcePosition()