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.1.tar.gz (40.2 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.1-py3-none-any.whl (44.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcpypack-0.4.1.tar.gz
  • Upload date:
  • Size: 40.2 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.1.tar.gz
Algorithm Hash digest
SHA256 6ab177fa1679125f4500d4deedecf89b27e151bd78583af6a60d09a868d33899
MD5 baf0aee6c931497db3191ba2a6cf6dac
BLAKE2b-256 bb84838010ea063349674abecb9bb832cf8e776a9041afa64767a91cfec42952

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mcpypack-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 44.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ebb614d8465c420755c6c61539124400cd54ee34c9f2577319eec33a93015fa
MD5 0a045431359920adac05ac8e66d55d5a
BLAKE2b-256 90153ed4817494ebe71ae2d97151f2bba2c40bff31f219498afd6e287d23754b

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