world_loader module

class api.world_loader._WorldLoader[source]

Bases: object

Class responsible for loading worlds

get_loaded_identifiers()[source]

List all format loader identifiers

Return type:List[str]
Returns:List of all format identifiers
identify(directory)[source]

Identifies the level format the world is in and the versions definitions that match the world. Note: Since Minecraft Java versions below 1.12 lack version identifiers, they will always be loaded with 1.12 definitions.

Parameters:directory (str) – The directory of the world
Return type:Tuple[str, str]
Returns:The version definitions name for the world and the format loader that would be used
load_world(directory, format=None, forced=False)[source]

Loads the world located at the given directory with the appropriate version/format loader.

Parameters:
  • directory (str) – The directory of the world
  • format (Optional[str]) – The loader name to use
  • forced (bool) – Whether to force load the world even if incompatible
Return type:

World

Returns:

The loaded world