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, PlainText, TextColor, Formatting
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,
                ),
                components.ItemName(PlainText(
                    text="MCpypack Sword",
                    formatting=Formatting(
                        color=TextColor.AQUA,
                        bold=True,
                    )
                ))
            )
        )
    ),
)

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

# Export the datapack
pack.export()

Website

  • See documentation about MCpypack under our Website

Tests

Roadmap

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.3.tar.gz (67.5 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.3-py3-none-any.whl (94.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mcpypack-0.5.3.tar.gz
Algorithm Hash digest
SHA256 c8c1320f7fafe955981372855a3c191fc1fe56d391c58b523ff78a8e57fa2ff1
MD5 fe47f92dd41c99d644033497406af384
BLAKE2b-256 34548976afdbeb085fb073411fd84e3e0c4d405618cf77f5078d3d8f3319ae56

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mcpypack-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2a97b4292ac28d72e5c472195365ba42ad6aa382d531232a84f1ca25c44741bd
MD5 c249fd2dd4a31db41c7e6861310133be
BLAKE2b-256 cd004d164bfc03cef4caf2327c35e388e552bfd0eedb71e4ea637a0b003b4ada

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