public class NpcHitNpcEvent extends Event implements Cancellable
NpcDeathEvent| Constructor and Description |
|---|
NpcHitNpcEvent(Npc attackerNpc,
Npc targetNpc,
short damage,
float distance) |
| Modifier and Type | Method and Description |
|---|---|
Npc |
getAttacker()
Gets the attacking npc, i.e. the npc who hit the target npc.
|
short |
getDamage()
Gets the amount of damage this hit will cause.
|
Npc |
getNpc()
Gets the target npc, i.e. the npc which was hit by the attacker.
|
boolean |
isCancelled()
Determines if the event is cancelled.
|
void |
setCancelled(boolean cancel)
Cancels this event.
|
void |
setDamage(short damage)
Sets the amount of damage that will be caused by this hit.
|
public Npc getAttacker()
public Npc getNpc()
public void setDamage(short damage)
damage - the new damage amount.public short getDamage()
public boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
CancellablesetCancelled in interface Cancellablecancel - set to true if you want to cancel this event.