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.
Install
pip install chanty
CLI Usage
Creating Project
chanty create test-project
cd test-project
Build Datapack
You should use
chanty build MAIN_FILE:PACK_VARIABLE --ARGS
for default .minecraft folder destionation:
chanty build main:pack --world_name="New World"
for ModrinthApp:
chanty build main:pack --modrinth="ProfileName:New World"
for other destination:
chanty build main:pack --to="./builds/datapack"
export to ./builds/<datapack_name> folder:
chanty build main:pack --output="./builds"
Development Mode
You can start dev mode to export your datapack in live mode after any .py file changes.
There are --save_folder, --world_name and --modrinth arguments.
chanty dev main:pack --modrinth="ProfileName:New World"
Up Project
After changing chanty version you can use chanty up to sync your project structure with actual chanty version
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 ...
- Assets
- Translations
- More built-in event handlers
- CLI improvement
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chanty-0.3.0.tar.gz.
File metadata
- Download URL: chanty-0.3.0.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2aaf7d444ca26bec7b224142ec7463fe71b1e493c2a91e42b439d134a83aa005
|
|
| MD5 |
38135b8615bc9a0e7bc746b08b6fbba2
|
|
| BLAKE2b-256 |
3b8fb678be5949d9e13b5210dfd25c6f7b0ca5da1cefb3ad025d13592e84cfeb
|
File details
Details for the file chanty-0.3.0-py3-none-any.whl.
File metadata
- Download URL: chanty-0.3.0-py3-none-any.whl
- Upload date:
- Size: 28.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1d34df7b18d8b0428abe306e77982d2fc785f4101a972849fb85e3ed7ddb047
|
|
| MD5 |
c7886fe0301b5c0754bd6e0095fe87d0
|
|
| BLAKE2b-256 |
c97257388189105ed6e973d4d384866240f7bd048ae42b3bdb53bc1030eaaff0
|