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
for default .minecraft folder destionation:
chanty build --world_name="New World"
for ModrinthApp:
chanty build --modrinth="ProfileName:New World"
for other destination:
chanty build --to="./builds/datapack"
export to ./builds/<datapack_name> folder:
chanty build --output="./builds"
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
chanty-0.2.1.tar.gz
(17.0 kB
view details)
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
chanty-0.2.1-py3-none-any.whl
(23.4 kB
view details)
File details
Details for the file chanty-0.2.1.tar.gz.
File metadata
- Download URL: chanty-0.2.1.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
201f1fd37ca5d24ed7b289d9ac22e35200edd57c6b208f46c2ee2ec7dcee582d
|
|
| MD5 |
62b9a5dbf82bcbc6c8725291fbfc00aa
|
|
| BLAKE2b-256 |
6f0729e5345dbf7e9b637729c6f39c080a57bc93b530bb1fd0c2bfbc37c6acdb
|
File details
Details for the file chanty-0.2.1-py3-none-any.whl.
File metadata
- Download URL: chanty-0.2.1-py3-none-any.whl
- Upload date:
- Size: 23.4 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 |
2264604addf79553389c626711cd79828cf761730d765451457fda4897cc0add
|
|
| MD5 |
f0d792775b6f7084a6779da7e4316780
|
|
| BLAKE2b-256 |
48cacd910dbfdeeab3d74b70ef12f89bce9605fcf5baaf8b2a5fd33045b5f22b
|