Skip to content

legopitstop/mcaddon

Repository files navigation

mcaddon

Tests PyPI Python Downloads Status Code style: black Issues

Utility functions for creating Minecraft Bedrock Add-Ons.

Installation

Install the module with pip:

pip3 install mcaddon

Update existing installation: pip3 install mcaddon --upgrade

Requirements

Name Usage
mini-racer JavaScript engine for Python
pillow Handling images
rapidnbt Reading/writing NBT
pydantic Data validation
mcpath Paths to Minecraft bedrock folders
mclang Read/write to .lang files
molang Molang translator & interpreter
commentjson Reading JSON files with comments
watchdog Monitor file system changes
Deprecated Deprecated files and functions

Features

  • Create Minecraft Bed rock add-ons with Python.
  • Build behavior packs and resource packs.
  • Define custom blocks and items.
  • Use a modular, component based system.
  • Export to Minecraft JSON files.
  • Load and edit existing packs.
  • Generate content with templates.
  • Tools for managing and packaging add-ons.
  • Optional scripting and integrations.

Examples

Block

from mcaddon import *

block = Block()
block.description.identifier = "test:on_interact_change_state_block"
block.components.add(BlockGeometryComponent())
block.components.add(
    BlockMaterialInstancesComponent().add(MaterialInstance(texture="stone"))
)
block.components.add(BlockCollisionBoxComponent())
block.components.add(BlockSelectionBoxComponent())
block.save("block.json")

Item

from mcaddon import *

item = Item()
item.description.identifier = "minecraft:blaze_rod"
item.components.add(ItemFuelComponent(duration=12))
item.components.add(ItemMaxStackSizeComponent(value=64))
item.components.add(ItemIconComponent().add("blaze_rod"))
item.components.add(ItemHandEquippedComponent())
item.components.add(ItemDisplayNameComponent(value="Blaze Rod"))
item.save("item.json")

Command-line interface

usage: mcaddon [-h] [-V] {show,package} ...

Description

positional arguments:
  {show,package}
    show                Shows a GUI for cli tools
    package             Package a pack or world

options:
  -h, --help            show this help message and exit
  -V, --version         print the mcaddon version number and exit.