Interface FabricTagKey
public interface FabricTagKey
General-purpose Fabric-provided extensions for
TagKey subclasses.
These extensions were designed primarily for giving extra utility methods for TagKeys usages. Getting a TagKey's translation key for example.
Note: This interface is automatically implemented on all TagKey instances via Mixin and interface injection.
-
Method Details
-
getTranslationKey
Use this to get a TagKey's translation key safely on any side.Format for vanilla registry TagKeys is: tag.(registry_path).(tag_namespace).(tag_path)
Format for modded registry TagKeys is: tag.(registry_namespace).(registry_path).(tag_namespace).(tag_path)
The registry's path and tag path's slashes will be converted to periods.
- Returns:
- the translation key for a TagKey
-
getName
default net.minecraft.network.chat.Component getName()Use this to get a TagKey's translatable component for display purposes.The component uses the result of
getTranslationKey()for the translation key and will fall back to displaying #tag_namespace:tag_path if no translation exists.- Returns:
- the translatable component for a TagKey
-