Skip to main content

Read and write Minecraft .mcstructure files.

Project description

mcstructure logo

mcstructure

Read and write Minecraft .mcstructure files.

🌍 This README is also available in the following languages:

Code Style Documentation Status PyPI

In the entire project (and officially since the "Better Together Update") the term "Minecraft" refers to the edition of Minecraft that is also known as the "Bedrock Edition".

Features that this library provides are only useful for the above named edition of Minecraft.

[!WARNING] This project is currently in the BETA version. Some features may not work as expected and might change without backwards compability or deprecation warnings.

This library lets you programmatically create and edit Minecraft structures. You are able to save these as .mcstructure files and for example use them in behavior packs.

You may as well read them to identify blocks and and entities that were saved with a Structure Block in-game.

Installation

pip install mcstructure

Basic Usage

from mcstructure import Block, Structure

struct = Structure(
    (7, 7, 7),
    Block("minecraft:wool", color = "red")
)

(struct
    .set_block((1, 1, 1), Block("minecraft:grass"))
    .set_block((2, 2, 2), Block("minecraft:grass"))
    .set_block((3, 3, 3), Block("minecraft:grass"))
    .set_block((4, 4, 4), Block("minecraft:grass"))
    .set_block((5, 5, 5), Block("minecraft:grass"))
    .set_block((6, 6, 6), Block("minecraft:grass"))
)

with open("house.mcstructure", "wb") as f:
    struct.dump(f)
with open("house.mcstructure", "rb") as f:
    struct = Structure.load(f)

References

External Resources


NOT AN OFFICIAL MINECRAFT PRODUCT. NOT APPROVED BY OR ASSOCIATED WITH MOJANG.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcstructure-0.0.1b6.tar.gz (64.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcstructure-0.0.1b6-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file mcstructure-0.0.1b6.tar.gz.

File metadata

  • Download URL: mcstructure-0.0.1b6.tar.gz
  • Upload date:
  • Size: 64.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.13 Linux/6.16.1-arch1-1

File hashes

Hashes for mcstructure-0.0.1b6.tar.gz
Algorithm Hash digest
SHA256 d7c92ad594ae4a9a965c55de0863c8ccd2d846db2fbbd1ebf79717a1c78447b9
MD5 d2ae2f45dc7fa6494cb798acf3806c8a
BLAKE2b-256 baf1459e412358c392d25e947fe2889afc9d564db2856d94eafd1b54e70fd096

See more details on using hashes here.

File details

Details for the file mcstructure-0.0.1b6-py3-none-any.whl.

File metadata

  • Download URL: mcstructure-0.0.1b6-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.13 Linux/6.16.1-arch1-1

File hashes

Hashes for mcstructure-0.0.1b6-py3-none-any.whl
Algorithm Hash digest
SHA256 043e32bbf2016142b0d12c4f4ed81c75e5ce9b23ce3719648c295a9d28039ccc
MD5 98b140141befd94f8a6bb72c68a15016
BLAKE2b-256 69f88fb2c26e7266e1e3fbe5cc028ea4b90556a3450bcaf1bf4240bee7afe95a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page