Skip to main content

Flare datapack compiler framework

Project description

Flare Logo

Flare 🔥

Programmatic Minecraft Datapacks in Python

Write Minecraft logic using full Python power: scores, NBT, execute chains, recursion, and more. Compile to optimized datapacks instantly.


Read the full documentation at: flare.oguzhanumutlu.com


What is Flare?

Flare is a modern framework for building Minecraft datapacks natively in Python. It bridges the gap between Python's high-level elegance and Minecraft's native mcfunction performance. You can use standard Python syntax, variables, and math, and Flare automatically translates and compiles your logic into highly-optimized, scoreboard-driven datapacks.

Installation

pip install flaremc

Quick Start: Advanced Math & NBT

With Flare, writing advanced datapack logic is incredibly clean. Below is a quick example of defining variables, doing advanced floating-point math natively in Minecraft, running terminal commands, and interacting with NBT.

from flare import namespace, score, math, nbt, expand

# Define your datapack namespace
namespace("my_pack")

# Declare a scoreboard variable and initialize it to 10
x = score(10)

# Compute math dynamically using native scoreboard approximations (Taylor series, CORDIC, etc.)
# All complex math compiles to highly optimized raw scoreboard operations!
result = math.sin(x) * math.sqrt(x)

# Print the dynamic float result back to the game seamlessly
print(f"The result is: {result}")

# Interact seamlessly with Minecraft's NBT environment
player_data = @a.Data[dict]

# Flare smartly manages conditional blocks and inlines commands when appropriate
if expand(x > 5):
    say "X is greater than 5!"
    kill @e[type=zombie, distance=..10]

Compile & Run

To compile your datapack to a .mcfunction structure, simply run:

flare main.py

To compile and immediately run it using the built-in emulator:

flare main.py --run

Documentation

Ready to unleash the full power of Python in Minecraft?

Check out the interactive playground and full documentation at flare.oguzhanumutlu.com!

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

flaremc-0.3.0.tar.gz (52.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flaremc-0.3.0-py3-none-any.whl (61.4 kB view details)

Uploaded Python 3

File details

Details for the file flaremc-0.3.0.tar.gz.

File metadata

  • Download URL: flaremc-0.3.0.tar.gz
  • Upload date:
  • Size: 52.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for flaremc-0.3.0.tar.gz
Algorithm Hash digest
SHA256 bd1d0f6d2aa94c3c2a70a764fa2924659fbcf7b06e02d0f0e0a6be126d810ceb
MD5 35c9031c231d795cc4b2378fa729f013
BLAKE2b-256 ebe3b4cd5118425fe0211ef8e9c51cf0d531f1853f45d0f7ec4df487785f4c93

See more details on using hashes here.

File details

Details for the file flaremc-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: flaremc-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 61.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for flaremc-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f3a722431387a4bacf2ab14a271e5c6d42f0e1b1b321c0a3553b53036e53523
MD5 c06b3dd1392d4d95b01620f7147795cc
BLAKE2b-256 890d45254b6bf115605aa09e3d486f9da6ffe7e83c6a40f82db4ee4711658a1a

See more details on using hashes here.

Supported by

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