Class EntityDamageEvent
java.lang.Object
com.welcome234.pluginsystem.events.EntityDamageEvent
Called when a entity takes damage
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn enum used for entity damage causes -
Constructor Summary
ConstructorsConstructorDescriptionEntityDamageEvent(int entityID, int damage, EntityDamageEvent.DamageCause cause, String playerAttacker) -
Method Summary
Modifier and TypeMethodDescriptionGets the player who attacked this entity, or null if the damage was not caused by a playerintGets the amount of damage this entity has takenGets the cause of the damageGets the entity who taken the damagebooleanGets whether this event is cancelledvoidsetCancelled(boolean cancelled)Sets the cancellation status of this event
-
Constructor Details
-
EntityDamageEvent
public EntityDamageEvent(int entityID, int damage, EntityDamageEvent.DamageCause cause, String playerAttacker)
-
-
Method Details
-
getEntity
Gets the entity who taken the damage- Returns:
- Entity instance
-
getDamageAmount
public int getDamageAmount()Gets the amount of damage this entity has taken- Returns:
- Damage taken
-
getDamageCause
Gets the cause of the damage- Returns:
- Damage cause
-
getAttackerPlayer
Gets the player who attacked this entity, or null if the damage was not caused by a player- Returns:
- Player instance
-
isCancelled
public boolean isCancelled()Gets whether this event is cancelled- Returns:
- Whether cancelled
-
setCancelled
public void setCancelled(boolean cancelled)Sets the cancellation status of this event- Parameters:
cancelled- Whether cancelled
-