Table of Contents

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

float

DamageStackOnImpact

How much ProjectileStack should be damage on impact.

bool DamageStackOnImpact { get; set; }

Property Value

bool

DamageTier

Projectile damage tier when hitting an entity.

int DamageTier { get; set; }

Property Value

int

DamageType

Projectile damage type when hitting an entity.

EnumDamageType DamageType { get; set; }

Property Value

EnumDamageType

DropOnImpactChance

Chance for projectile to not be destroyed on impact.

float DropOnImpactChance { get; set; }

Property Value

float

EntityHit

Will return true if projectile hit at least one entity.

bool EntityHit { get; }

Property Value

bool

FiredBy

Entity that spawned the projectile

Entity? FiredBy { get; set; }

Property Value

Entity

IgnoreInvFrames

If damage source done by projectile will ignore invincibility frames.

bool IgnoreInvFrames { get; set; }

Property Value

bool

NonCollectible

If projectile can be collected when stuck.

bool NonCollectible { get; set; }

Property Value

bool

ProjectileStack

Projectile item, can be dropped on impact, or damaged, or destroyed.

ItemStack? ProjectileStack { get; set; }

Property Value

ItemStack

Stuck

If projectile is stuck in terrain.

bool Stuck { get; set; }

Property Value

bool

WeaponStack

Weapon item stack used to shoot this projectile.

ItemStack? WeaponStack { get; set; }

Property Value

ItemStack

Weight

Projectile wieght used for knockback calculations.

float Weight { get; set; }

Property Value

float

Methods

PreInitialize()

Sets initial rotation if needed. Should be called each time entity is spawned before it spawned.

void PreInitialize()