Skip to main content

Tool for creating cool Minecraft datapacks

Project description

Chanty

Write Minecraft datapacks easely with Python

chanty is a Python DSL for writing Minecraft datapacks as if they were real code.
No more messy .mcfunction files - just cliean, structured logic.

Features

  • Pythonic Datapack Development Write Minecraft datapack using real Python code instead of raw .mcfunction files.
  • Command Builder API Generate complex Minecraft commands (execute, summon, scoreboard, etc.) programmatically and dynamically.
  • Custom Item System Create fully functional custom items with names, lore, events and NBT attributes - all in code.
  • Hot Reloading Automatically rebuild and export your dapatack whenever a Python file changes (you still should to use /reload command in game).
  • Automatic Resourcepack Exporting Export resourcepaks as ready-to-import .zip archives.

Install

pip install chanty

CLI Usage

Creating Project

chanty create test-project

cd test-project

Build Datapack

To build and export your datapack, use:

chanty build MAIN_FILE:PACK_VARIABLE --ARGS

Exporting to the default .minecraft saves folder:

chanty build main:pack --world_name="New World"

Exporting to Modrinth App:

chanty build main:pack --modrinth="ProfileName:New World"

Exporting to a custom destination:

chanty build main:pack --to="./builds/datapack"

Exporting to a ./builds/<datapack_name> folder:

chanty build main:pack --output="./builds"

Development Mode

You can start the dev mode to automatically re-export your datapack every time any .py file changes.

Supported arguments: --save_folder, --world_name, and --modrinth.

chanty dev main:pack --modrinth="ProfileName:New World"

Up Project

After updating your Chanty version, use:

chanty up

to synchronize your project structure with the latest Chanty template.

Usage

Simple example

from chanty import Datapack, Namespace, CommandBuilder

pack = DataPack('my_awesome_datapack')
namespace = Namespace('main')

@namespace.on_load
def handle_on_load() -> str:
    with CommandBuilder() as cmd:
        cmd.tellraw('Hello world from chanty datapack!')
    return cmd.build()


# Export into folder
if __name__ == '__main__':
    pack.export('./my_datapack')

Custom Items

from chanty import DataPack Namespace, CommandBuilder, CustomItem, Item


pack = DataPack('my_awesome_datapack')
namespace = Namespace('main')

my_cool_item = CustomItem(Item.STICK)
my_cool_item.set_name('§6§l[Chanty]§f§r Debugger')
my_cool_item.set_lore(
    'This is a not just stick ...',
    'This is a §6§l[Chanty]§f§r Debugger!',
)
my_cool_item.glint(True)
@my_cool_item.on_right_click
def handle_right_click():
    with CommandBuilder() as cmd:
        cmd.say('Hello!')
    return cmd.build()

namespace.register(my_cool_item)

if __name__ == '__main__':
    pack.export('./my_datapack')

In The Future ...

  • Asset management
  • Achievements
  • More built-in event hooks
  • CLI improvements

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

chanty-0.4.1.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chanty-0.4.1-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chanty-0.4.1.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.8

File hashes

Hashes for chanty-0.4.1.tar.gz
Algorithm Hash digest
SHA256 a937280030e0b43c68aa70df5ed68c7c8e60bcd258d523b633b10dd5d2335808
MD5 d45d49c43dc75d747c200b2e12dbb042
BLAKE2b-256 d83820d218203152b0e817990d57909dfb2ac8d8a6a3ccdb04bdfcd209f0f7b8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chanty-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.8

File hashes

Hashes for chanty-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fbcf8c08bda00e1e24f72608dfd70db228b2ac3e05f8bba3fe302440522c31db
MD5 a4928180150f8cb5e6b325aa0c40dd51
BLAKE2b-256 b3eaac98cf79942b614fbc4f862f04c3f797a39fad0a74a990ef0e3f6f7d65aa

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