mclangres module

Uses .minecraft/assets/indexes/[version].json. The version is the highest found by default.

mclangres.addMissing(*args, **kwargs)[source]
mclangres.buildResources(version=None, lang=None)[source]

Loads the resource files and builds the resource dictionnaries. Four dictionnaries are built. Two for the refering language (English), and two for the language to be used. They are ‘reversed’ dictionnaries; the {foo: bar} pairs of one are the {bar: foo} of the other one.

mclangres.compound(char, string, pair=None)[source]
mclangres.findResourceFile(name, basedir)[source]
mclangres.getResourceName(name, data)[source], untranslate=False, capitalize=True, filters=[])[source]

Search for a text string in the resources entries. filters is a list of strings: they must be parts before the ‘=’ sign in the resource files, or parts of. filters may be regexes. Returns a sorted list of matching elements.


Returns returns the translation of name, or name if no translation found. Can handle composed strings like: ‘string_present_in_translations (other_string_1, other_string_2)’. Note that, in this case, the returned string may be partially translated.

mclangres.untranslate(name, case_sensitive=True)[source]

Basic reverse function of translate.