diff --git a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricLanguageProvider.java b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricLanguageProvider.java index 30d896f57c..8522d02037 100644 --- a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricLanguageProvider.java +++ b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricLanguageProvider.java @@ -207,7 +207,12 @@ default void add(RegistryEntry entityAttribute, String value) { * @param value The value of the entry. */ default void add(StatType statType, String value) { - add("stat_type." + Registries.STAT_TYPE.getId(statType).toString().replace(':', '.'), value); + if (statType.getName() instanceof TranslatableTextContent translatableTextContent) { + add(translatableTextContent.getKey(), value); + return; + } else { // fallback to Util.createTranslationKey formatting (should it error instead?) + add(Util.createTranslationKey("stat_type", Registries.STAT_TYPE.getId(statType)), value); + } } /**