Interface PlayerStats
public interface PlayerStats
A player's lifetime statistics in Zentrix.
The values cover every game the player has participated in.
Example
PlayerStats stats = ZentrixProvider.get()
.getProfileService()
.getCachedStats(player.getUniqueId());
int wins = stats.getWins();
int kills = stats.getKills();
double kd = stats.getKDRatio();
double winRate = stats.getWinRate();
player.sendMessage("Stats - Wins: " + wins + ", K/D: " + kd);
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault intLifetime assists.default doubleAssists per match played, with two decimals.default doubleDamage taken per match played, with two decimals.doubleCalculates the average kills per game.doubleCalculates the average survival time per game, in seconds.intGets the current consecutive win streak.doubleGets the total damage dealt across all games.default doubledoubleGets the total damage taken across all games.intGets the total number of deaths across all games.default doubleMost damage dealt in a single match.intGets the highest number of kills achieved in a single game.intGets the highest kill streak achieved in a single game.intGets the highest consecutive win streak ever achieved.doubleCalculates the kill/death ratio.intgetKills()Gets the total number of kills across all games.default doubleLongest ranged kill, in blocks from where the shot was fired.doubleGets the longest survival time in a single game, in seconds.default intGets the number of losses (matches played minus wins).intGets the total number of matches played.default intMatches whose placement was recorded.default intKills whose killing blow was a projectile.default doubleShare of kills that were ranged, as a percentage with two decimals.default @NotNull List<RecentMatch> The player's most recent matches, newest first, as many as Zentrix keeps.default @NotNull ModeStatsSolo matches only.default intTeammates this player revived.default @NotNull ModeStatsTeam matches only.default intMatches finished in the top three.default doubleShare of placed matches finished in the top three, as a percentage with two decimals.doubleGets the total survival time across all games, in seconds.doubleCalculates the win rate as a percentage.intgetWins()Gets the total number of games won.default booleanChecks if the player has any recorded statistics.
-
Method Details
-
getWins
int getWins()Gets the total number of games won.- Returns:
- Total wins
-
getMatchesPlayed
int getMatchesPlayed()Gets the total number of matches played.- Returns:
- Total matches played
-
getKills
int getKills()Gets the total number of kills across all games.- Returns:
- Total kills
-
getDeaths
int getDeaths()Gets the total number of deaths across all games.- Returns:
- Total deaths
-
getDamageDealt
double getDamageDealt()Gets the total damage dealt across all games.- Returns:
- Total damage dealt
-
getDamageTaken
double getDamageTaken()Gets the total damage taken across all games.- Returns:
- Total damage taken
-
getHighestKillGame
int getHighestKillGame()Gets the highest number of kills achieved in a single game.- Returns:
- Highest kills in one game
-
getHighestKillStreak
int getHighestKillStreak()Gets the highest kill streak achieved in a single game.- Returns:
- Highest kill streak
-
getTotalSurvivalTime
double getTotalSurvivalTime()Gets the total survival time across all games, in seconds.- Returns:
- Total survival time in seconds
-
getLongestSurvivalTime
double getLongestSurvivalTime()Gets the longest survival time in a single game, in seconds.- Returns:
- Longest survival time in seconds
-
getCurrentWinStreak
int getCurrentWinStreak()Gets the current consecutive win streak.This resets to 0 when the player loses a game.
- Returns:
- Current win streak
-
getHighestWinStreak
int getHighestWinStreak()Gets the highest consecutive win streak ever achieved.- Returns:
- Highest win streak
-
getKDRatio
double getKDRatio()Calculates the kill/death ratio.If deaths is 0, returns the kill count as the ratio.
- Returns:
- K/D ratio rounded to 2 decimal places
-
getWinRate
double getWinRate()Calculates the win rate as a percentage.Returns 0 if no matches have been played.
- Returns:
- Win rate percentage (0-100)
-
getAverageKills
double getAverageKills()Calculates the average kills per game.Returns 0 if no matches have been played.
- Returns:
- Average kills per game
-
getAverageSurvivalTime
double getAverageSurvivalTime()Calculates the average survival time per game, in seconds.Returns 0 if no matches have been played.
- Returns:
- Average survival time in seconds
-
getLosses
default int getLosses()Gets the number of losses (matches played minus wins).- Returns:
- Total losses
-
hasPlayed
default boolean hasPlayed()Checks if the player has any recorded statistics.Returns true if the player has played at least one match.
- Returns:
trueif the player has played any games
-
getTopThreeFinishes
default int getTopThreeFinishes()Matches finished in the top three.- Returns:
- Top-three finishes
- Since:
- 1.8.0
-
getPlacedMatches
default int getPlacedMatches()Matches whose placement was recorded. Matches played before Zentrix tracked placements are not counted, so rates based on placements are not diluted by them.- Returns:
- Matches with a recorded placement
- Since:
- 1.8.0
-
getTopThreeRate
default double getTopThreeRate()Share of placed matches finished in the top three, as a percentage with two decimals.- Returns:
- Top-three rate, or 0 without a placed match
- Since:
- 1.8.0
-
getAssists
default int getAssists()Lifetime assists.- Returns:
- Assists
- Since:
- 1.8.0
-
getAverageAssists
default double getAverageAssists()Assists per match played, with two decimals.- Returns:
- Average assists, or 0 without matches
- Since:
- 1.8.0
-
getTeammatesRevived
default int getTeammatesRevived()Teammates this player revived.- Returns:
- Teammates revived
- Since:
- 1.8.0
-
getRangedKills
default int getRangedKills()Kills whose killing blow was a projectile.- Returns:
- Ranged kills
- Since:
- 1.8.0
-
getLongestRangedKill
default double getLongestRangedKill()Longest ranged kill, in blocks from where the shot was fired.- Returns:
- The distance, or 0 without a ranged kill
- Since:
- 1.8.0
-
getHighestDamageGame
default double getHighestDamageGame()Most damage dealt in a single match.- Returns:
- Highest damage in one match
- Since:
- 1.8.0
-
getAverageDamageTaken
default double getAverageDamageTaken()Damage taken per match played, with two decimals.- Returns:
- Average damage taken, or 0 without matches
- Since:
- 1.8.0
-
getSoloStats
Solo matches only.- Returns:
- The solo share of this profile
- Since:
- 1.8.0
-
getTeamStats
Team matches only.- Returns:
- The team share of this profile
- Since:
- 1.8.0
-
getRecentMatches
The player's most recent matches, newest first, as many as Zentrix keeps.- Returns:
- An unmodifiable list (never null, may be empty)
- Since:
- 1.8.0
-
getDamageRatio
default double getDamageRatio()
-