Amulet Core API Reference
Contents:
amulet.api
packageamulet.api.block
moduleamulet.api.block_entity
moduleamulet.api.chunk
packageamulet.api.data_types
packageamulet.api.entity
moduleamulet.api.errors
moduleamulet.api.level
packageamulet.api.partial_3d_array
packageamulet.api.registry
packageamulet.api.selection
packageamulet.api.wrapper
package
amulet.level.formats
packageamulet.utils
package
- amulet.load_level(path)[source]
Load and return a
World
orStructure
class exposing the data atpath
Calls
load_format()
to try and find aFormatWrapper
that can open the data.If one is found it will wrap it with either a
World
orStructure
class and return it.- Parameters:
path (
str
) – The file path to a file or directory for the object to be loaded.- Return type:
- Returns:
A World or Structure class instance containing the data.
- Raises:
LoaderNoneMatched: If no loader could be found that can open the data at path.
Exception: Other errors.
- amulet.load_format(path)[source]
Find a valid subclass of
FormatWrapper
and return the data wrapped in the class. This exposes a low level API to read and write the world data.Inspects the data at the given path to find a valid subclass of
FormatWrapper
.If a valid wrapper is found it is set up and returned.
This is not recommended for new users and does not include a history system.
- Parameters:
path (
str
) – The file path to a file or directory for the object to be loaded.- Return type:
- Returns:
An instance of WorldFormatWrapper or StructureFormatWrapper containing the data at path.
- Raises:
LoaderNoneMatched: If no loader could be found that can open the data at path.
Exception: Other errors.