Class PlayerDamageInfo

java.lang.Object
de.marcely.bedwars.api.arena.PlayerDamageInfo

public class PlayerDamageInfo extends Object
Contains info of the last even in which a player directly or indirectly received damaged.
See Also:
  • Field Details

    • MAX_AGE_MS

      public static final long MAX_AGE_MS
      Get the max age, until an instance is counted as invalid.
      See Also:
  • Constructor Details

    • PlayerDamageInfo

      public PlayerDamageInfo()
  • Method Details

    • getDamager

      public Player getDamager()
      Get the player who directly/indirectly caused the game.
      Returns:
      The damaging player
    • getEvent

      public EntityDamageByEntityEvent getEvent()
      Get the event that was used to obtain this info from.
      Returns:
      The related event
    • getTimeMs

      public long getTimeMs()
      Get the time in ms when this info was obtained.
      Returns:
      The time this info was constructed
    • getProjectileDamager

      @Nullable public @Nullable Projectile getProjectileDamager()
      Tries to get the projectile that was used to damage the player.
      Returns:
      The projectile used in this event. May be null if none has been used
    • isOutdated

      public boolean isOutdated()
      Get whether the age of this object is larger than MAX_AGE_MS.
      Returns:
      Get whether this object is outdated, and thus won't be used internally