pymcfunc
Minecraft functions, pythonised. Made by 7d
Latest release version: v0.4 Changelogs: https://pymcfunc.readthedocs.io/en/latest/changelog.html
Documentation: https://pymcfunc.readthedocs.io/en/latest/
Why pymcfunc?
It would seem pretty obvious to program directly with Minecraft commands into functions; however things start to get complicated when you try to do things that are simple in regular programming but are cumbersome in Minecraft commands.
Hence pymcfunc, which translates Python code into Minecraft commands. The code is aimed to be short, brief and concise so that it does not become another troublesome job.
Progress: Raw commands are complete, currently working on features to make programming functions easier, and tools to build datapacks :)
Usage
import pymcfunc as pmf
p = pmf.Pack("pack name")
@p.function
def diamond(f: pmf.JavaFuncHandler):
f.r.tell("@s", "Enjoy your free diamonds! :D")
f.r.give("@s", "diamond", 64)
@p.function
def make_sheep_jump(f: pmf.JavaFuncHandler):
f.r.execute(
as_="@e[type=sheep]",
run=lambda sf: [
sf.r.tp(destxyz="~ ~1 ~"),
sf.r.say("boingg")
]
)
@p.function
def addition(f: pmf.JavaFuncHandler):
val1 = f.v('val1', '@s')
val1.set(10)
val2 = f.v('val2', '@s')
val2.set(20)
val1 += val2
f.r.tellraw('@s', pmf.rt.java("§aThe value is now ¶s[val1|@s]"))
@p.function
@p.t.repeat_every(6000)
def five_min_alert(f: pmf.JavaFuncHandler):
f.r.tellraw('@a', pmf.rt.java("§c§l§w[This is 6000 ticks]5 minutes§xw have passed!"))
print(p.funcs)
Release files for pymcfunc 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pymcfunc-0.4.tar.gz | 58.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pymcfunc-0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 120.3 kB
Release files / pymcfunc-0.4.tar.gz
| Download URL | pymcfunc-0.4.tar.gz |
|---|---|
| Size | 58.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee13bf3158d71924c203281e94428d7c22cb6b23ae2476751f580e43b9846785
|
|
BLAKE2b-256 checksum How to use checksums |
69ff2001de1e4e04274a2a88e5a02b71e5538826ba16626aa68f72551ee80679
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6
|
Release files / pymcfunc-0.4-py3-none-any.whl
| Download URL | pymcfunc-0.4-py3-none-any.whl |
|---|---|
| Size | 61.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d94577ac1b581971a5b9d452f480b30804ee94170cb4fbdc01f75fa110e7250
|
|
BLAKE2b-256 checksum How to use checksums |
e700061a8885c544ddca85f126f7840ec0035f1a023b89e0f3483c1fd332e5bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6
|