Version class

class PyMCTranslate.py3.api.version.version.Version(version_path, translation_manager)[source]

Bases: object

This class contains all the specification and translation files for the game version that it represents. There will be an instance of this class in the TranslationManager for each unique combination of platform and version number.

Important

This class should not be directly initiated. You should first create a TranslationManager class and call TranslationManager.get_version to get the required Version class.

property biome

The BiomeTranslator for this version

Return type

BiomeTranslator

property block

The BlockTranslator for this version

Return type

BlockTranslator

property block_format

The native format of the blocks for this game version.

This will be one of “numerical”, “pseudo-numerical”, “blockstate” or “nbt-blockstate”.

“numerical” is the old storage format where both block id and data value were numerical values.

“pseudo-numerical” is the in-between Bedrock format where block ids were namespaced strings but data was still numerical.

“blockstate” is the new Java format where the block ids are all namespaced strings and the data is stored as properties in NBT.TAG_String format.

“nbt-blockstate” is the new Bedrock format where the block ids are all namespaced strings and the data is stored as properties in various NBT types.

Return type

str

property data_version

The DataVersion number of the version this class instance holds the data of. This is an int but is only used for Java versions beyond 1.9 snapshot 15w32a and Bedrock versions beyond 1.10. Other versions will default to 0.

Return type

int

property entity

The EntityTranslator for this version

Return type

EntityTranslator

property has_abstract_format

Property to access if the version has a second custom blockstate format to abstract away the old numerical format. If this is true the force_blockstate input to various methods can be used to switch between the native and abstract format. If this is false the native format will be used regardless.

Return type

bool

property item

The ItemTranslator for this version

Return type

ItemTranslator

property platform

The platform name of the version this class instance holds the data of. Currently these are ‘java’, ‘bedrock’ and ‘universal’

Return type

str

property version_number

The version number of the version this class instance holds the data of. eg (1, 13, 2)

Return type

Tuple[int, int, int]