private void OnAttack(EntityAttackEventArgs e) { foreach (EventListener el in Plugins) { if (el.Event == Event.ENTITY_ATTACK) { EntityListener l = el.Listener as EntityListener; l.OnAttack(e); } } }
public override void Attack(LivingEntity target) { if (target == null) return; short weaponDmg = GetWeaponDamage(); //Start Event EntityAttackEventArgs e = new EntityAttackEventArgs(this, weaponDmg, target); Server.PluginManager.CallEvent(Event.EntityAttack, e); if(e.EventCanceled) return; target = (LivingEntity)e.EntityToAttack; weaponDmg = e.Damage; //End Event target.Damage(DamageCause.EntityAttack, weaponDmg, this); }
public virtual void OnAttack(EntityAttackEventArgs e) { }