world module

class api.world.World(directory, root_tag, wrapper)[source]

Bases: object

Class that handles world editing of any world format via an separate and flexible data format

get_block(x, y, z)[source]

Gets the blockstate at the specified coordinates

Parameters:
  • x (int) – The X coordinate of the desired block
  • y (int) – The Y coordinate of the desired block
  • z (int) – The Z coordinate of the desired block
Return type:

str

Returns:

The blockstate name as a string

get_chunk(cx, cz)[source]

Gets the chunk data of the specified chunk coordinates

Parameters:
  • cx (int) – The X coordinate of the desired chunk
  • cz (int) – The Z coordinate of the desired chunk
Return type:

Chunk

Returns:

The blocks, entities, and tile entities in the chunk

class api.world.WorldFormat[source]

Bases: object

Base class for World objects

classmethod from_unified_format(unified)[source]

Converts the passed object to the specific implementation

Parameters:unified (World) – The object to convert
Return object:The result of the conversion, None if not successful
Return type:WorldFormat
classmethod load(directory, definitions)[source]

Loads the Minecraft world contained in the given directory with the supplied definitions

Parameters:
  • directory (str) – The directory of the world to load
  • definitions – The definitions to load the world with
Return type:

World

Returns:

The loaded world in a World object

save()[source]

Saves the current WorldFormat to disk

Return type:None