Nbtschematic
A simple schematic file reader for nbtlib
Install / Use
/learn @cbs228/NbtschematicREADME
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
Related Skills
node-connect
354.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
