Package noppes.npcs.api.event
Interface INpcEvent.DamagedEvent
-
- All Superinterfaces:
ICustomNPCsEvent,INpcEvent
- Enclosing interface:
- INpcEvent
public static interface INpcEvent.DamagedEvent extends INpcEvent
Fired when the NPC takes damage. Cancelable.- Hook Name:
- damaged
-
-
Nested Class Summary
-
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 booleangetClearTarget()floatgetDamage()IDamageSourcegetDamageSource()IEntitygetSource()StringgetType()voidsetClearTarget(boolean bo)voidsetDamage(float damage)-
Methods inherited from interface noppes.npcs.api.event.ICustomNPCsEvent
getHookName
-
-
-
-
Method Detail
-
getSource
IEntity getSource()
- Returns:
- the entity that caused the damage, or null.
-
getDamageSource
IDamageSource getDamageSource()
- Returns:
- the damage source details.
-
getDamage
float getDamage()
- Returns:
- the damage amount.
-
setDamage
void setDamage(float damage)
- Parameters:
damage- the new damage amount.
-
setClearTarget
void setClearTarget(boolean bo)
- Parameters:
bo- whether to clear the NPC's current target after damage.
-
getClearTarget
boolean getClearTarget()
- Returns:
- whether the NPC's target will be cleared after damage.
-
getType
String getType()
- Returns:
- the damage type string.
-
-