Skip to main content

Bolt datapack flow control library.

Project description

crankshaft

GitHub Actions

Flow control library for the Bolt scripting language.

Introduction

Minecraft version: 1.19.4

This library implements various flow control APIs, which excel at speeding up prototyping and creating datapacks.

from crankshaft:api import Listener
from crankshaft:events import on_load, on_player_join, on_player_jump
from crankshaft:flags import is_sneaking

@Listener(on_load)
def load():
    tellraw @a "datapack loaded!"

@Listener(on_player_join)
def player_join():
    say "I just joined the server!"

@Listener(on_player_jump)
def player_jump():
    if not is_sneaking:
        tellraw @a "JUMP!"
    else:
        tellraw @a "JUMP!... (I was sneaking as well)"

Installation

pip install crankshaft

Getting started

The library is designed to be used within any bolt script (either a .mcfunction or bolt file) inside a bolt enabled project.

require:
    - bolt
    - crankshaft

pipeline:
    - mecha

Once you've required bolt and crankshaft, you are able to import the package's api module directly inside your bolt script.

Most of the imports come from the crankshaft:api module as shown below.

from crankshaft:api import Listener

Now you're free to use the API!

Documentation

Coming soon...


License - MIT

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

crankshaft-0.8.1.tar.gz (14.4 kB view hashes)

Uploaded Source

Built Distribution

crankshaft-0.8.1-py3-none-any.whl (33.6 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