A simple schematic file reader for nbtlib
Project description
nbtschematic
A simple nbtlib Schema for reading or writing Schematic files for MCEdit and other world editors.
Installation
Python 3.6 or higher is required.
pip3 install nbtschematic
Examples
To load an existing MCEdit or other schematic file from disk, run:
from nbtschematic import SchematicFile
sf = SchematicFile.load('tests/test_schematic/simple.schematic')
print("The block at Y=%d, Z=%d, X=%d has block ID %d" %
(2, 3, 0, sf.blocks[2, 3, 0]))
To generate a schematic file in python, run:
from nbtschematic import SchematicFile
sf = SchematicFile(shape=(10, 8, 4))
assert sf.blocks.shape == (10, 8, 4)
sf.blocks[2, 3, 0] = 42
sf.save('example.schematic')
The size of the schematic should be defined at construction time. Resizing it will clear the blocks and block data.
Other fields of interest include:
data
: Block data for each and every blockentities
: Everything that is not a blockblockentities
: Extended metadata for blocks
Further Reading
For more information about the underlying objects, see nbtlib
's excellent
examples
page.
License - MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for nbtschematic-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b517f7c05cd79a1e754a8315a12e91a074fb94b9a19875ea04a1dc90fff708e |
|
MD5 | 20a1fbbb43e0bb3dc99c423608ddd26c |
|
BLAKE2b-256 | 0f0851e15d0b9a1b9530d81ff8ca9bc2d7c49465d9bb774df29c66f4f0ef9e2f |