Skip to main content

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 block
  • entities: Everything that is not a block
  • blockentities: Extended metadata for blocks

Further Reading

For more information about the underlying objects, see nbtlib's excellent examples page.


License - MIT

Release files for nbtschematic 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for nbtschematic 0.2.1
File Interpreter ABI Platform
nbtschematic-0.2.1-py3-none-any.whl Python 3 none any Details

Release files / nbtschematic-0.2.1-py3-none-any.whl

Download URL nbtschematic-0.2.1-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37b16287469395ce0c2be71c5633dc7498aa8d8dca6ad6226114c05522eba55b
BLAKE2b-256 checksum
How to use checksums
79457cf66ff1cb66851dd656f6b9dc159b6ec625f6a597c7c48d3257cb67a714
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.2.1 This release

1 release file

0.2.0

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page