Class EntityDamageEvent

java.lang.Object
com.welcome234.pluginsystem.events.EntityDamageEvent

public class EntityDamageEvent extends Object
Called when a entity takes damage
  • Constructor Details

  • Method Details

    • getEntity

      public Entity 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

      public EntityDamageEvent.DamageCause getDamageCause()
      Gets the cause of the damage
      Returns:
      Damage cause
    • getAttackerPlayer

      public Player 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