Skip to main content

Python library for easy creation of Minecraft datapacks

Project description

MCpypack

Python PyPI License Downloads

  • Create Minecraft Datapacks easily using Python

⚠️ Early Development: This project is still in early development. Features may change and bugs may occur.

Features

  • Easy datapack creation
  • Namespaces
  • Recipes

Installation

pip intall MCpypack

Example

from MCpypack.core import Datapack, Namespace
from MCpypack.recipe import CraftingShapeless
from MCpypack.utils import ItemStack, Rarity, SwingAnimation
from MCpypack import components
from MCpypack.item.final import Item, Enchantment, DamageType

# Create a new datapack
pack = Datapack(name="mcpypack", description='mcpypack yay', version='26.1')

# Create a new namespace
ns1 = Namespace('recipes')

# Add recipes to the namespace
ns1.add_recipes(
    CraftingShapeless(
        name="python",
        ingredients=[Item.DIAMOND_SWORD, Item.COPPER_INGOT],
        result=ItemStack(
            item_id=Item.COPPER_SWORD,
            count=1,
            components=components.ItemComponents(
                components.EnchantmentGlintOverride(True),
                components.AttackRange(
                    max_reach=25
                ),
                components.DamageType(
                    DamageType.LIGHTNING_BOLT
                ),
                components.Rarity(
                    Rarity.EPIC
                ),
                components.Weapon(
                    item_damage_per_attack=0,
                    disable_blocking_for_seconds=5
                ),
                components.Unbreakable(),
                components.Enchantments(
                    {
                        Enchantment.KNOCKBACK: 50,
                        Enchantment.SHARPNESS: 5,
                    }
                ),
                components.SwingAnimation(
                    animation_type=SwingAnimation.STAB,
                    duration=10,
                )
            )
        )
    ),
)

# Add the namespace to the datapack
pack.add_namespaces(ns1)

# Export the datapack
pack.export()

Website

  • See documentation about MCpypack under our Website

Tests

License

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

mcpypack-0.5.2.tar.gz (64.1 kB view details)

Uploaded Source

Built Distribution

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

mcpypack-0.5.2-py3-none-any.whl (89.4 kB view details)

Uploaded Python 3

File details

Details for the file mcpypack-0.5.2.tar.gz.

File metadata

  • Download URL: mcpypack-0.5.2.tar.gz
  • Upload date:
  • Size: 64.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for mcpypack-0.5.2.tar.gz
Algorithm Hash digest
SHA256 630c04c399e4cd7fc30e6ff2fd58cdf4897a8946d3715ba83d7f25406dd9e413
MD5 1af0338af4e283a8f2365670f79a6297
BLAKE2b-256 ae304ab2e57e068ad1185bb4d3d86979aed13aae075975b71960a9a4ae469027

See more details on using hashes here.

File details

Details for the file mcpypack-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: mcpypack-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 89.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for mcpypack-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6f13e85cf2c7ec0ca19a6cf2e9245615574ee54628a6981c90866c4f0a7fb154
MD5 4e6fce26875dbeaa4e50b55586bb87a2
BLAKE2b-256 97d2fdf84e536748f9ddcef7badcf8a7f4c8993600f6699c891e043c0b3ad4db

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