Package noppes.npcs.api.event
Interface IAbilityEvent.HitEvent
-
- All Superinterfaces:
IAbilityEvent,ICustomNPCsEvent,INpcEvent
- Enclosing interface:
- IAbilityEvent
public static interface IAbilityEvent.HitEvent extends IAbilityEvent
Fired when an ability hits an entity with damage. Canceling this event prevents the damage from being applied.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface noppes.npcs.api.event.IAbilityEvent
IAbilityEvent.CompleteEvent, IAbilityEvent.ExecuteEvent, IAbilityEvent.HitEvent, IAbilityEvent.InterruptEvent, IAbilityEvent.StartEvent, IAbilityEvent.TickEvent, IAbilityEvent.ToggleEvent, IAbilityEvent.ToggleUpdateEvent
-
Nested classes/interfaces inherited from interface noppes.npcs.api.event.ICustomNPCsEvent
ICustomNPCsEvent.CNPCNaturalSpawnEvent, ICustomNPCsEvent.ScriptedCommandEvent
-
Nested classes/interfaces inherited from interface noppes.npcs.api.event.INpcEvent
INpcEvent.CollideEvent, INpcEvent.DamagedEvent, INpcEvent.DialogClosedEvent, INpcEvent.DialogEvent, INpcEvent.DiedEvent, INpcEvent.InitEvent, INpcEvent.InteractEvent, INpcEvent.KilledEntityEvent, INpcEvent.MeleeAttackEvent, INpcEvent.RangedLaunchedEvent, INpcEvent.SwingEvent, INpcEvent.TargetEvent, INpcEvent.TargetLostEvent, INpcEvent.TimerEvent, INpcEvent.UpdateEvent
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description floatgetDamage()Get the damage amount.IEntityLivingBasegetHitEntity()Get the entity that was hit by the ability.floatgetKnockback()Get the horizontal knockback amount.floatgetKnockbackUp()Get the vertical knockback (upward force) amount.voidsetDamage(float damage)Set the damage amount.voidsetKnockback(float knockback)Set the horizontal knockback amount.voidsetKnockbackUp(float knockbackUp)Set the vertical knockback (upward force) amount.-
Methods inherited from interface noppes.npcs.api.event.IAbilityEvent
getAbility, getEntity, getPlayer, getTarget, isNPC
-
Methods inherited from interface noppes.npcs.api.event.ICustomNPCsEvent
getHookName
-
-
-
-
Method Detail
-
getHitEntity
IEntityLivingBase getHitEntity()
Get the entity that was hit by the ability.- Returns:
- the entity that was hit
-
getDamage
float getDamage()
Get the damage amount.- Returns:
- the damage amount
-
setDamage
void setDamage(float damage)
Set the damage amount. Allows scripts to modify damage.- Parameters:
damage- the new damage amount
-
getKnockback
float getKnockback()
Get the horizontal knockback amount.- Returns:
- the knockback strength
-
setKnockback
void setKnockback(float knockback)
Set the horizontal knockback amount.- Parameters:
knockback- the new knockback strength
-
getKnockbackUp
float getKnockbackUp()
Get the vertical knockback (upward force) amount.- Returns:
- the upward knockback component
-
setKnockbackUp
void setKnockbackUp(float knockbackUp)
Set the vertical knockback (upward force) amount.- Parameters:
knockbackUp- the new upward knockback component
-
-