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.8 or higher is required. You should probably create a new virtual environment before you install. Once you have activated your virtual environment, run
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 Distribution
Built Distribution
File details
Details for the file nbtschematic-0.2.0.tar.gz
.
File metadata
- Download URL: nbtschematic-0.2.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.0.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 219e334a605ea02b041de075145680a7c8187ccfea9873cad3ba6c29bfc09529 |
|
MD5 | 19fc67c9f410ea462da8112b028a0e33 |
|
BLAKE2b-256 | f94a4973f9089281a5863753b9dfbee6dd5d6536a41f62eb0a8fd2e674ea1bed |
File details
Details for the file nbtschematic-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: nbtschematic-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.0.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52211fb630a8e3f5636d8fe9b9e861346ac394fbe22cc6a18df8b41dfe5eb66e |
|
MD5 | 8e7e6ff1fa45c2900ce793351d29b569 |
|
BLAKE2b-256 | b37a2015a6e6518a3dae87be5eb8c08926bc68b8da8a341a35027bb7630dc7e8 |