Skip to content

CanCreateWorldProjectile

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void CanCreateWorldProjectile( HitInfo info, ItemDefinition itemDef )
{
    Puts( "CanCreateWorldProjectile works!" );
}

Location

  • BasePlayer::CreateWorldProjectile(HitInfo info, ItemDefinition itemDef, ItemModProjectile itemMod, Projectile projectilePrefab, Item recycleItem)
csharp
protected virtual void CreateWorldProjectile(HitInfo info, ItemDefinition itemDef, ItemModProjectile itemMod, Projectile projectilePrefab, Item recycleItem)
{
	if (Interface.CallHook("CanCreateWorldProjectile", info, itemDef) != null)
	{
		return;
	}
	Vector3 projectileVelocity = info.ProjectileVelocity;
	Item item = (recycleItem != null) ? recycleItem : ItemManager.Create(itemDef, 1, 0uL, true);
//---

Released under the MIT License.