net.minestom.server.statistic.PlayerStatistic Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minestom-snapshots Show documentation
Show all versions of minestom-snapshots Show documentation
1.20.4 Lightweight Minecraft server
package net.minestom.server.statistic;
import net.minestom.server.entity.Player;
import org.jetbrains.annotations.NotNull;
/**
* Represents a single statistic in the "statistics" game menu.
*
* You can retrieve the statistics map with {@link Player#getStatisticValueMap()} and modify it with your own values.
*/
public class PlayerStatistic {
private final StatisticCategory category;
private final int statisticId;
public PlayerStatistic(@NotNull StatisticCategory category, int statisticId) {
this.category = category;
this.statisticId = statisticId;
}
public PlayerStatistic(@NotNull StatisticType type) {
this(StatisticCategory.CUSTOM, type.id());
}
@NotNull
public StatisticCategory getCategory() {
return category;
}
public int getStatisticId() {
return statisticId;
}
}