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 import *

# Create a new datapack
pack = Datapack(name="useful_recipes", description='Adds useful recipes like GOD Apple and grass blocks', version='1.21.10')

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

# Add recipes to the namespace
ns1.add_recipes(
    Smelting("burning_gundpowder", Item.GUNPOWDER, SimpleResult(Item.FIRE_CHARGE), Time(Seconds(2),Milliseconds(500))),
    Smoking("tearing_eyes", Item.ENDER_PEARL, SimpleResult(Item.ENDER_EYE), Time(Minutes(2),Seconds(30)),experience=5),
    Blasting("blasting_obsidian_until_it_cries", Item.OBSIDIAN, SimpleResult(Item.CRYING_OBSIDIAN), Time(Seconds(10)),experience=1),
    
    CraftingShapeless(
        name="grass_block",
        ingredients=[[Item.SHORT_GRASS,Item.SHORT_DRY_GRASS,Item.TALL_DRY_GRASS,Item.TALL_GRASS], Item.DIRT],
        result=CountedResult(Item.GRASS_BLOCK)
    ),
    Stonecutting(
        name="wooden_chair",
        ingredient=Item.OAK_PLANKS,
        result=CountedResult(Item.OAK_STAIRS, count=1)
    ),
    CampfireCooking(
        name="wood_coal",
        ingredient=[Item.OAK_LOG, Item.ACACIA_LOG, Item.BIRCH_LOG, Item.CHERRY_LOG, Item.DARK_OAK_LOG, Item.JUNGLE_LOG, Item.MANGROVE_LOG, Item.PALE_OAK_LOG, Item.SPRUCE_LOG],
        result=SimpleResult(Item.CHARCOAL),
        cookingtime=Time(Seconds(5)),
        experience=0.5
    ),
    CampfireCooking(
        name="weedy_bread",
        ingredient=Item.WHEAT,
        result=SimpleResult(Item.BREAD),
        cookingtime=Time(Minutes(1),Seconds(30)),
        experience=3
    ),
    CraftingShaped(
        name="god_apple",
        pattern=["AAA", "ABA", "AAA"],
        key={"A": Item.GOLD_BLOCK, "B": Item.APPLE},
        result=CountedResult(Item.ENCHANTED_GOLDEN_APPLE)
    ),
    CraftingShaped(
        name="totem_of_dying",
        pattern=["ABA", "AAA", " A "],
        key={"A": Item.GOLD_BLOCK, "B": [Item.DIAMOND, Item.EMERALD]},
        result=CountedResult(Item.TOTEM_OF_UNDYING)
    ),
    CratfingTransmute(
        name="irond_pickaxe",
        input=Item.IRON_PICKAXE,
        material=Item.DIAMOND,
        result=SimpleResult(Item.DIAMOND_PICKAXE),
        category=Category.EQUIPMENT,
    )
)

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

# Export the datapack
pack.export(overwrite=True)

Website

  • See documentation about MCpypack under our Website

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.4.3.tar.gz (53.7 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.4.3-py3-none-any.whl (62.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mcpypack-0.4.3.tar.gz
Algorithm Hash digest
SHA256 c80723dc22cd0774e9ba0e06166ed540b90252c49c56c3bcaaff92b7c7afee7e
MD5 b11b1bad67c4d90d592038abf48a2eba
BLAKE2b-256 b3bbad7780abf36e16ca4937fb11e8b193e0727e8f316c2e8303dc0e5e2aa18c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mcpypack-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 62.5 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.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2fed6c5c4f14b1634ca3fc073184ebe494d5ad7653c757e6bb3a559e63d1cfc6
MD5 69c6b95ade6d92fd223c93dd0b2b64c1
BLAKE2b-256 bf57555293148272d094ac54c5633685a034a99c4425d9e8518aaed4a6905f00

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