LabAPI icon indicating copy to clipboard operation
LabAPI copied to clipboard

[IDEA] Add IAttackerEvent or set Player to Target and add ITargetEvent

Open ui2506 opened this issue 10 months ago • 0 comments

Goal Description

Add the Attacker interface to events or change Player to Target. Since there's no interface, I can't subscribe to multiple events with the same method.

For some reason, events with both Attacker and Player only have the IPlayer interface. For example: DeathEventArgs, TeleportedEventArgs, and etc.

Example:

      //PlayerEvents.DeathEventArgs and Scp106Events.TeleportedEventArgs

        private void HealScpOnAttck<T>(T ev) where T : IAttackerEvent
        {
            if (ev.Attacker != null && Plugin.ScpHeal.TryGetValue(ev.Attacker.Role, out ushort heal))
                ev.Attacker.Heal(heal);
        }

Notes

No response

ui2506 avatar Jan 30 '26 09:01 ui2506