Interface IProjectile
- Namespace
- Vintagestory.API.Common.Entities
- Assembly
- VintagestoryAPI.dll
Interface for universal approach to spawning projectile entities.
Some of the properties may not be used by all projectiles. But they can still be set or read.
public interface IProjectile
- Extension Methods
Properties
Damage
Projectile damage when hitting an entity.
float Damage { get; set; }
Property Value
DamageStackOnImpact
How much ProjectileStack should be damage on impact.
bool DamageStackOnImpact { get; set; }
Property Value
DamageTier
Projectile damage tier when hitting an entity.
int DamageTier { get; set; }
Property Value
DamageType
Projectile damage type when hitting an entity.
EnumDamageType DamageType { get; set; }
Property Value
DropOnImpactChance
Chance for projectile to not be destroyed on impact.
float DropOnImpactChance { get; set; }
Property Value
EntityHit
Will return true if projectile hit at least one entity.
bool EntityHit { get; }
Property Value
FiredBy
Entity that spawned the projectile
Entity? FiredBy { get; set; }
Property Value
IgnoreInvFrames
If damage source done by projectile will ignore invincibility frames.
bool IgnoreInvFrames { get; set; }
Property Value
NonCollectible
If projectile can be collected when stuck.
bool NonCollectible { get; set; }
Property Value
ProjectileStack
Projectile item, can be dropped on impact, or damaged, or destroyed.
ItemStack? ProjectileStack { get; set; }
Property Value
Stuck
If projectile is stuck in terrain.
bool Stuck { get; set; }
Property Value
WeaponStack
Weapon item stack used to shoot this projectile.
ItemStack? WeaponStack { get; set; }
Property Value
Weight
Projectile wieght used for knockback calculations.
float Weight { get; set; }
Property Value
Methods
PreInitialize()
Sets initial rotation if needed. Should be called each time entity is spawned before it spawned.
void PreInitialize()