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
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 = pack.namespace('recipes')

# Create an ItemStack
python_sword = ItemStack \
    .item(Item.COPPER_SWORD) \
    .count(1) \
    .component(components.EnchantmentGlintOverride(True)) \
    .component(components.AttackRange(
        max_reach=25,
    )) \
    .component(components.DamageType(DamageType.LIGHTNING_BOLT)) \
    .component(components.Rarity(Rarity.EPIC)) \
    .component(components.Weapon(
            item_damage_per_attack=0,
            disable_blocking_for_seconds=5.0
    )) \
    .component(components.Enchantments(
        {
            Enchantment.KNOCKBACK: 50,
            Enchantment.SHARPNESS: 5,
        }
    )) \
    .component(components.SwingAnimation(
            animation_type=SwingAnimation.STAB,
            duration=10,
    )) \
    .component(components.ItemName(PlainText(
        text="MCpypack Sword",
        formatting=Formatting(
            color=TextColor.AQUA,
            bold=True,
        )
    )))

# Add recipes to the namespace
ns1.add_recipes(
    CraftingShapeless(
        name="python",
        ingredients=[Item.DIAMOND_SWORD, Item.COPPER_INGOT],
        result=python_sword
    )
)

# 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.4.tar.gz (68.6 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.4-py3-none-any.whl (96.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcpypack-0.5.4.tar.gz
  • Upload date:
  • Size: 68.6 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.4.tar.gz
Algorithm Hash digest
SHA256 f50050f9f97de21b48c3e62c6f065b45b1464ae3ea4262ed36afdb9751a4897f
MD5 82dd8d3c52bc52a9d0781c9c514386f8
BLAKE2b-256 d6cb8c7bb55d96a973ce8de4664374cc8e91d7d54bcb582e29e1672854c7ded2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mcpypack-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 96.2 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ecdcce0981f82c213100ef79d4de6bbb359092c03832addcb76ee1f36ee41894
MD5 f21bdcead554f390f6c5118860e1f59a
BLAKE2b-256 c589ab497c14016b292f709d5cee8e691debc5fd92765034c835c2aa9fe462bd

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