Class PlayerDamageEvent

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

public class PlayerDamageEvent extends Object
Called when a player takes damage
  • Constructor Details

  • Method Details

    • getPlayer

      public Player getPlayer()
      Gets the player who taken the damage
      Returns:
      player instance
    • getDamageAmount

      public int getDamageAmount()
      Gets the amount of damage this player has taken
      Returns:
      Damage taken
    • getDamageCause

      public PlayerDamageEvent.DamageCause getDamageCause()
      Gets the cause of the damage
      Returns:
      Damage cause
    • getAttackerEntity

      public Entity getAttackerEntity()
      Gets the entity who attacked this player, or null if the damage was not caused by an entity
      Returns:
      Entity instance
    • getAttackerPlayer

      public Player getAttackerPlayer()
      Gets the player who attacked this player, 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