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.0.tar.gz (21.8 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.0-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chanty-0.4.0.tar.gz
  • Upload date:
  • Size: 21.8 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.0.tar.gz
Algorithm Hash digest
SHA256 4c269a57b2b491d2118ad992096fff6a9d7bc2dc61312cef5fb3a16f73f4914f
MD5 9e99dd89c1a3a5f36078c377471e6f67
BLAKE2b-256 b653e233be19c10c0c2b589d6a379345abd98b607d1555fad289cc3269f98af4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chanty-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 30.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 beea35a6a65bd151f51c1221202c358ebb1d606d4b8b521ae1eab586d6b678c6
MD5 b2145ffc8a54e661f79af717551d8a49
BLAKE2b-256 b04e16258da912ee1c06db7e2ebd1529bb8e85979b74057a013bbc538c68f01f

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