Table of Contents

Class CustomGrenade

Namespace
Exiled.CustomItems.API.Features
Assembly
Exiled.CustomItems.dll

The Custom Grenade base class.

public abstract class CustomGrenade : CustomItem
Inheritance
CustomGrenade
Inherited Members
Extension Methods

Properties

ExplodeOnCollision

Gets or sets a value indicating whether gets or sets a value that determines if the grenade should explode immediately when contacting any surface.

public abstract bool ExplodeOnCollision { get; set; }

Property Value

bool

FuseTime

Gets or sets a value indicating how long the grenade's fuse time should be.

public abstract float FuseTime { get; set; }

Property Value

float

Type

Gets or sets the ItemType to use for this item.

public override ItemType Type { get; set; }

Property Value

ItemType

Methods

Check(Projectile)

Checks to see if the grenade is a custom grenade.

public virtual bool Check(Projectile grenade)

Parameters

grenade Projectile

The grenade to check.

Returns

bool

True if it is a custom grenade.

OnChangedIntoGrenade(ChangedIntoGrenadeEventArgs)

Handles the tracking of custom grenade pickups that are changed into live grenades by a frag grenade explosion.

protected virtual void OnChangedIntoGrenade(ChangedIntoGrenadeEventArgs ev)

Parameters

ev ChangedIntoGrenadeEventArgs

ChangedIntoGrenadeEventArgs.

OnExploding(ExplodingGrenadeEventArgs)

Handles tracking exploded custom grenades.

protected virtual void OnExploding(ExplodingGrenadeEventArgs ev)

Parameters

ev ExplodingGrenadeEventArgs

ExplodingGrenadeEventArgs.

OnThrowingRequest(ThrowingRequestEventArgs)

Handles tracking thrown requests by custom grenades.

protected virtual void OnThrowingRequest(ThrowingRequestEventArgs ev)

Parameters

ev ThrowingRequestEventArgs

ThrowingRequestEventArgs.

OnThrownProjectile(ThrownProjectileEventArgs)

Handles tracking thrown custom grenades.

protected virtual void OnThrownProjectile(ThrownProjectileEventArgs ev)

Parameters

ev ThrownProjectileEventArgs

ThrownProjectileEventArgs.

SubscribeEvents()

Called after the manager is initialized, to allow loading of special event handlers.

protected override void SubscribeEvents()

Throw(Vector3, float, float, float, ItemType, Player?)

Throw the CustomGrenade object.

public virtual Pickup Throw(Vector3 position, float force, float weight, float fuseTime = 3, ItemType grenadeType = ItemType.GrenadeHE, Player? player = null)

Parameters

position Vector3

The UnityEngine.Vector3position to throw at.

force float

The amount of force to throw with.

weight float

The floatWeight of the Grenade.

fuseTime float

The floatFuseTime of the grenade.

grenadeType ItemType

The ItemTypeof the grenade to spawn.

player Player

The Player to count as the thrower of the grenade.

Returns

Pickup

The Pickup spawned.

UnsubscribeEvents()

Called when the manager is being destroyed, to allow unloading of special event handlers.

protected override void UnsubscribeEvents()