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.
- See Also:
-
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.Get the Instant when this info was obtained.@Nullable Projectile
Tries to get the projectile that was used to damage the player.long
Deprecated.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
Deprecated.UsegetInstant()
insteadGet the time in ms when this info was obtained.- Returns:
- The time this info was constructed
-
getInstant
Get the Instant when this info was obtained.- Returns:
- The instant 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
-
getInstant()
instead