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)

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.2.tar.gz (51.8 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.2-py3-none-any.whl (57.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcpypack-0.4.2.tar.gz
  • Upload date:
  • Size: 51.8 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.2.tar.gz
Algorithm Hash digest
SHA256 c443671b775e656acddae3ddb9d94645f42c4b1b9faa1c1b197a83d20b31409d
MD5 49a5bc8e7864617634a58d7442bde4f0
BLAKE2b-256 798785d5010539051f5960ff6b89107bfbff66f91b2b771ebd0d0ccd95be8b66

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mcpypack-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 57.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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8d4b7ba284f0cf77e5e18c397a240ce97071b4fe419b35543a29a648316e1e11
MD5 acda1b5d65e11d53fce0f31eb84475de
BLAKE2b-256 0d6ff386bd2dff985056aa620a0cef5bcf46e566e2d495625c856b0a302295de

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