SwiftlyS2

IOnEntityTakeDamageEvent

Interface IOnEntityTakeDamageEvent

Namespace: SwiftlyS2.Shared.Events

Assembly: SwiftlyS2.CS2.dll

Called when an entity takes damage.

[Obsolete("This event is deprecated and will be removed in future versions. Use GameHooks.Entities.TakeDamage instead.")]
public interface IOnEntityTakeDamageEvent

Properties

DamageResult

The damage result. Throws System.InvalidOperationException when the native call did not provide a result. Use SwiftlyS2.Shared.GameHooks.IGameHooks.Entities to access the nullable native result.

ref CTakeDamageResult DamageResult { get; }
Property Value

Entity

The entity that took damage.

CEntityInstance Entity { get; }
Property Value

Info

The damage info.

ref CTakeDamageInfo Info { get; }
Property Value

Result

If return SwiftlyS2.Shared.Misc.HookResult.Stop or SwiftlyS2.Shared.Misc.HookResult.CancelOriginal, the damage will not be applied.

HookResult Result { get; set; }
Property Value

On this page