Skip to main content

Radon is a programming language that gets compiled to Minecraft: Java Edition's mcfunction files.

Project description

 Radon

Radon is a programming language that gets compiled to Minecraft: Java Edition's mcfunction files.

Radon code

Discord Server

Documentation

Documentation is available on GitHub Pages.

Usage

First install the package using:

pip install radonmc

Now run radon while being inside your datapack's folder and that's it!

Syntax

a = 10
a += 10
a -= 10
a *= 10
a /= 10
a++
a--

b = 10.5
c = [1, 2, 3]
d = [c, c, c]
e = {"myKey": a, "myOtherKey": c, "myOtherOtherKey": d}
e.myOtherOtherKey[0][2] // this is c[2] which is 3

// To run commands just type them:
say hi

// Multi line commands are available, you can break the new line character with backslash:
execute       \
  as @a       \
  at @s       \
  run say hi

// If you want to define a variable with no initial value you just do this:
define int my_var

a += c[2] - (d[0][1] * 10) / (d[1][2] + 7) // Supports mathematical expressions

// You can break lines in expressions too!
val = 10 + \
 5 - 4 * \
 a + 5

fl = 10.5
fl += 5.23

a:@s = 10 // sets it for @s

a:@s // gets it from @s

fn my_func(float x, float y, float z) {
    tp @a $(x) $(y) $(z)
    return x + y + z
}

my_func(1.3, 2.7, 3.3)

fn tick {
    // This will run every tick
}

as @p at @s {
}

if (a == 1) {
} else if (a == 2) {
} else {
}

// Some more syntactic sugar for readability! (Optional)
if (a is 1 or b is 5) {

}

unless (a == 1) { // This is a shortcut for: if (a == 1) {} else { say hi }
  say hi
}

schedule 1t {
}

loop {
}

for (i = 0; i < 10; i++) {
}

while (a == 1) {
}

until (a == 1) {
}

do {
} while (a == 1)

do {
} until (a == 1)

loop 1t {
}

for 1t (i = 0; i < 10; i++) {
}

while 1t (a == 1) {
}

until 1t (a == 1) {
}

do {
} while 1t (a == 1)

do {
} until 1t (a == 1)

// break and continue can be used in any loop like this:

loop {
    if (a == 1) break // Exits the loop
    if (a == 2) continue // Stops the loop and restarts from the first line of the loop
}

class MyClass {
    a = 10
    b = [1, 2, 3]
    
    MyClass(int a) {
        this.a = a
        this.b[0] = 5
    }
    
    increaseTheA() {
        this.a++
    }
}

myInstance = MyClass(50)
myInstance.increaseTheA()

print(myInstance.a) // it's 51

Project details


Release history Release notifications | RSS feed

This version

1.9.9

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

radonmc-1.9.9.tar.gz (57.2 kB view details)

Uploaded Source

Built Distribution

radonmc-1.9.9-py3-none-any.whl (71.2 kB view details)

Uploaded Python 3

File details

Details for the file radonmc-1.9.9.tar.gz.

File metadata

  • Download URL: radonmc-1.9.9.tar.gz
  • Upload date:
  • Size: 57.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for radonmc-1.9.9.tar.gz
Algorithm Hash digest
SHA256 12272ddafac430163adf06080e7ae8c76fc5f5a81fe541a5f0b672ac6ed5dfbb
MD5 85f3baddb5c3be3463c283fa6165e7f0
BLAKE2b-256 b86bd4703216cd2bfb3311de5308120f30e7a71cb5649b654e5fc3fc91bfda53

See more details on using hashes here.

File details

Details for the file radonmc-1.9.9-py3-none-any.whl.

File metadata

  • Download URL: radonmc-1.9.9-py3-none-any.whl
  • Upload date:
  • Size: 71.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for radonmc-1.9.9-py3-none-any.whl
Algorithm Hash digest
SHA256 89ee2eac17422e248e06c77a51318e008a1fb7bf4edba23ca8d58d8b6b86400a
MD5 4f8e1585ba5cc9557d76e1e306dcf5de
BLAKE2b-256 5afdd73961e79d279ca00a7651ceba5be947d8c77da43b6583c74f813cda45f4

See more details on using hashes here.

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