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: BiomeTranslator

The BiomeTranslator for this version

property block: BlockTranslator

The BlockTranslator for this version

property block_format: str

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.

property data_version: int

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.

property entity: EntityTranslator

The EntityTranslator for this version

property has_abstract_format: bool

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.

property item: ItemTranslator

The ItemTranslator for this version

property platform: str

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

property version_number: Tuple[int, int, int]

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