Skip to main content

Minecraft functions, pythonised

Project description

pymcfunc

Build Status Documentation Status PyPI version Github Version Python Versions License

GitHub code size in bytes GitHub repo size GitHub last commit GitHub Release Date Lines of code Codecov CodeFactor

Minecraft functions, pythonised. Made by 7d

Latest release version: v0.1 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.

I'm writing code for the raw commands first - that being ordinary Minecraft commands. After the raw commands, shortcuts will be written to shorten and clarify several tasks. A datapack constructor will be made too :)

Usage

import pymcfunc as pmf
p = pmf.Pack()

@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")
      ]
    )

print(p.funcs)

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

pymcfunc-0.2.tar.gz (40.0 kB view hashes)

Uploaded Source

Built Distribution

pymcfunc-0.2-py3-none-any.whl (40.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page