A new way of coding Minecraft. Minecraft is a game that you can play on your computer. It is a popular game for people who are interested in building their own worlds. And since a way to code the game itself has been implemented, I tried it. But it was not simple. So I decided to make a generator for the Minecraft Datapacks, so people can make their own Datapacks easily, even though they still need to know Python until I can make it look like Scratch or something this easy.
- First of all make sure you have one of the latest Python version installed on your computer.
- Ensure you also have pip installed: try running the command "
pip3 -V
" in a terminal. - If this gets you an error message follow these steps to install it.
- Once you have Python and pip installed, run the command: "
pip3 install mcwpy
".
Now you should be able to import the library in your new Python programs you can use the project below to help you get started with the library:
import mcwpy
- Create and compile your own datapack.
- Once the datapack is generated, paste it in the datapacks folder of your Minecraft world.
- Type
/reload
to load the datapack. - Have fun playing with your brand new handmade datapack!
# -*- coding: ascii -*-
from mcwpy import *
workspace1 = Workspace(
name = 'my_workspace',
functions = {
'load': 'tellraw @a {"text":"Datapack loaded!"}',
'hello_world': 'say Hello World!'
}
)
my_datapack = Datapack(
title = 'My Datapack',
pack_mcmeta = Pack_Meta(
author = 'Myself',
description = 'My very own Minecraft datapack',
minecraft_version = Minecraft_Pack_Version.LATEST
),
workspaces = [workspace1]
)
workspace2 = Workspace(
functions = {
'main': 'title @a actionbar {"text":"Hey!"}',
'test': [
'say Test',
'execute as @s at @s run summon pig ~ ~ ~'
]
}
)
my_datapack.append(workspace2)
my_datapack.compile()
function my_workspace:hello_world
If you want to contribute to this project, you can do so by forking it and sending a pull request, I am opened to any idea and contribution.
Thanks to @theskyblockman for the idea of using workspaces. Thanks to @Silvathor for the idea of redesigning the workspaces.