structura-core
Reusable Minecraft Java 1.21.1 structure-processing core. It owns:
- validated Java Structure NBT I/O;
- legacy schematic conversion and numeric analysis;
- NumPy/SciPy voxel geometry primitives (connected components, closing).
Structure input accepts gzip-compressed and raw NBT, including files with multiple palettes. Saving preserves all palettes, root metadata, additional block fields, block entities and entities. Repeated saves of the same data produce reproducible gzip bytes; they need not match the original file bytes.
The library targets Minecraft Java 1.21.1 by default. Version constants live
in structura_core.version; callers can still pass an explicit Amulet
translation target to the legacy converter.
pip install structura-core
structura-analyze path/to/structure.nbt --json
The legacy extra is needed for legacy input conversion. Structure NBT
processing and Sponge v2 .schem export do not require amulet-core.
pip install 'structura-core[legacy]'
structura-convert-legacy old.schematic structure.nbt
structura-export-schematic structure.nbt structure.schem
For local development, use pip install -e '.[legacy]' from this package's
directory.
Legacy conversion keeps paintings and item frames by default, which is safe
for generated structures. Preview tools can call convert(..., preserve_all_entities=True) to retain mobs, armor stands and loose items as
well, including their exact fractional positions and NBT payloads.
For conversion that retains selection bounds, authored air, bedrock and block
connections, pass prepare_for_placement=False as well, or use:
structura-convert-legacy old.schematic preserved.nbt --preserve-layout --all-entities
The converter's historical default still prepares a structure for datapack placement: it trims bounds, replaces bedrock, repairs pane/bar connections and selects interior/door-clearance air. Preview tools use the preserving mode. Conversion retains custom entity namespaces and supplies translated block entity IDs, allowing the result to be exported as Sponge without guessing IDs.
Generated additions fill missing cells and preserve authored cells, including
explicit air. Use replacements to intentionally replace a cell; replacement
also removes its old block entity NBT. Coordinates and palette indices must be
integers in the NBT range. Every saved block is bounds-checked, and a failed
write leaves an existing destination intact.
from structura_core import Structure, save_structure
from structura_core.export_schematic import export_schematic
structure = Structure("house.nbt", palette_index=0)
save_structure(structure, "copy.nbt", structure.size)
export_schematic(structure, "house.schem")
Selecting palette_index chooses the active view without discarding the other
palettes on save. An integer addition selects the corresponding variant in
each palette; a string such as "minecraft:stone" adds that literal state to
every palette. Shifts update entity positions and known vanilla hanging-entity
coordinates, while retaining unrelated custom NBT.
Sponge v2 has a single palette and a dense block array: export uses the selected
palette and fills missing cells with air. Entities and block entity payloads
are included; an entity without an id raises an error. This export does not
translate Minecraft versions, and the output retains the source DataVersion.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file structura_core-0.2.3.tar.gz.
File metadata
- Download URL: structura_core-0.2.3.tar.gz
- Upload date:
- Size: 39.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58b5ed99f5437a9a44de12bb7684412b76eaa36b158b285e10b0d3650ef06a26
|
|
| MD5 |
eea225d8bcb5fd0eaf46985ab9f3c020
|
|
| BLAKE2b-256 |
4f26fb3bebe43bb3a09ac99885a1359570184e6c978e52b26e6600a4f3130e3b
|
Provenance
The following attestation bundles were made for structura_core-0.2.3.tar.gz:
Publisher:
publish.yml on kirimba1024/structura-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
structura_core-0.2.3.tar.gz -
Subject digest:
58b5ed99f5437a9a44de12bb7684412b76eaa36b158b285e10b0d3650ef06a26 - Sigstore transparency entry: 2748274479
- Sigstore integration time:
-
Permalink:
kirimba1024/structura-core@8b0f1b0735822f437781616c60e57b9c744c9c58 -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/kirimba1024
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8b0f1b0735822f437781616c60e57b9c744c9c58 -
Trigger Event:
release
-
Statement type:
File details
Details for the file structura_core-0.2.3-py3-none-any.whl.
File metadata
- Download URL: structura_core-0.2.3-py3-none-any.whl
- Upload date:
- Size: 38.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba0ee8a8bdc7a218b8c81adce88ccd9511c7d5b66cb522a2382ee06ae921132c
|
|
| MD5 |
2e99691a205990d2c355e94e17802e29
|
|
| BLAKE2b-256 |
3eef4b2e5b065a3d18ae27a438000848b9b3126b332e896f30cb2db199c7bf38
|
Provenance
The following attestation bundles were made for structura_core-0.2.3-py3-none-any.whl:
Publisher:
publish.yml on kirimba1024/structura-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
structura_core-0.2.3-py3-none-any.whl -
Subject digest:
ba0ee8a8bdc7a218b8c81adce88ccd9511c7d5b66cb522a2382ee06ae921132c - Sigstore transparency entry: 2748274539
- Sigstore integration time:
-
Permalink:
kirimba1024/structura-core@8b0f1b0735822f437781616c60e57b9c744c9c58 -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/kirimba1024
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8b0f1b0735822f437781616c60e57b9c744c9c58 -
Trigger Event:
release
-
Statement type: