Package de.marcely.bedwars.api.arena
Class PlayerDamageInfo
java.lang.Object
de.marcely.bedwars.api.arena.PlayerDamageInfo
Contains info of the last even in which a player directly or indirectly received damaged.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
Get the max age, until an instance is counted as invalid. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the player who directly/indirectly caused the game.getEvent()
Get the event that was used to obtain this info from.@Nullable Projectile
Tries to get the projectile that was used to damage the player.long
Get the time in ms when this info was obtained.boolean
Get whether the age of this object is larger thanMAX_AGE_MS
.
-
Field Details
-
MAX_AGE_MS
public static final long MAX_AGE_MSGet the max age, until an instance is counted as invalid.- See Also:
-
-
Constructor Details
-
PlayerDamageInfo
public PlayerDamageInfo()
-
-
Method Details
-
getDamager
Get the player who directly/indirectly caused the game.- Returns:
- The damaging player
-
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
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 thanMAX_AGE_MS
.- Returns:
- Get whether this object is outdated, and thus won't be used internally
-