ReadonlydataThe raw parsed JSON data of the asset file.
ReadonlydocstringsAll JSDoc-style comment blocks parsed from this asset's source file,
in document order. Empty array when no /** … */ blocks are present.
ReadonlyfileAbsolute path to the asset's file on disk. Empty string in browser mode.
ReadonlylanguageThe language code, e.g. "en_US", "fr_CA".
Returns all translation keys in this file.
Returns the number of translations.
Returns all translated values in this file.
Returns the translation for a key, or the key itself if not found. This matches Minecraft's behavior where missing translations show the raw key.
The translation key, e.g. "item.iron_sword.name"
The translated string, or the key if not found
Returns the translation for a key, or null if not found. Use this when you need to distinguish between missing translations and empty strings.
The translation key
The translated string, or null if not found
Returns all translations as an object. Useful for serialization or bulk operations.
Wraps a language
.langfile from the resource pack'stexts/directory. Provides access to translations for items, blocks, entities, and other keys.Example