Package net.fabricmc.fabric.api.tag
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
Use this to get a TagKey's translatable text for display purposes.The text uses the result of
invalid reference
TagKey#getTranslationKey
- Returns:
- the translatable text for a TagKey
-