diff --git a/paper-api/src/main/java/org/bukkit/UnsafeValues.java b/paper-api/src/main/java/org/bukkit/UnsafeValues.java index 3328ae3bab..8e0877321e 100644 --- a/paper-api/src/main/java/org/bukkit/UnsafeValues.java +++ b/paper-api/src/main/java/org/bukkit/UnsafeValues.java @@ -256,4 +256,6 @@ public interface UnsafeValues { @Deprecated(since = "1.21.3", forRemoval = true) void setBiomeKey(RegionAccessor accessor, int x, int y, int z, NamespacedKey biomeKey); // Paper end - namespaced key biome methods + + String getStatisticCriteriaKey(@NotNull org.bukkit.Statistic statistic); // Paper - fix custom stats criteria creation } diff --git a/paper-api/src/main/java/org/bukkit/scoreboard/Criteria.java b/paper-api/src/main/java/org/bukkit/scoreboard/Criteria.java index 7d79d7fada..3bc3abaf09 100644 --- a/paper-api/src/main/java/org/bukkit/scoreboard/Criteria.java +++ b/paper-api/src/main/java/org/bukkit/scoreboard/Criteria.java @@ -335,7 +335,7 @@ public interface Criteria { @NotNull public static Criteria statistic(@NotNull Statistic statistic) { Preconditions.checkArgument(statistic != null, "statistic must not be null"); - return Bukkit.getScoreboardCriteria("minecraft.custom:minecraft." + statistic.getKey().getKey()); + return Bukkit.getScoreboardCriteria(org.bukkit.Bukkit.getUnsafe().getStatisticCriteriaKey(statistic)); // Paper } /**