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 "Bedrock Edition".

Features that this library provide 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.

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)

Useful Links


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.1b5.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

mcstructure-0.0.1b5-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcstructure-0.0.1b5.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for mcstructure-0.0.1b5.tar.gz
Algorithm Hash digest
SHA256 fdcb728b9d7fc61b649c182cb4fcadc345c4dcc628b68a8fffeaf13881654979
MD5 49a78a79a8f69f1cd3ba504a2bbd02f0
BLAKE2b-256 4cf878707f8d39a0e6f115a552179bf22b1f73b0222842322c3e22cec67e0968

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcstructure-0.0.1b5-py3-none-any.whl
Algorithm Hash digest
SHA256 8356a96d4127f2d5b0005232c256f202b41b27fa29c25751e037acf04fe15bd1
MD5 c4b1535f5e0ad517225009ed9ef93a2a
BLAKE2b-256 a1e3bc66082a9a9b88e0bfc81ad56371988d2ec2938f02f2606a1d744d436ecc

See more details on using hashes here.

Supported by

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