Skip to main content

Compiler for JMC (JavaScript-like Minecraft Function), a mcfunction extension language for making Minecraft Datapack.

Project description

JMC · license-mit release build-passing discord-invite

(JavaScript-like Minecraft Function)

JMC (JavaScript-like Minecraft Function) is a mcfunction extension language for making Minecraft Datapack.

JMC-icon

Code example:

Text.tellraw(@a, "everything outside the function");
say "just goes into the load function";

function myFunc() { // function
    execute as @a at @s run {
        Text.tellraw(@a, "&<green,bold> this text is green and bold");
        say "this is a function executed through execute as @a";
    }
}
function varOperations() {
    // this variable x is equal to the number of items in hand
    $x = data get entity @s SelectedItem.Count;
    $y = 100; // this is the second variable
    $z = @s::SelectedItem.Count; // the same as $x
    $random_int = Math.random($x, $y);
    Text.tellraw(@a, "random number from &<$x> to 100: &<$random_int>");
}
class folder {
    function funcInFolder() {
        if ($x < $y && $random_int <= 50) {
            printf("X is less than Y and random number is less than or equal to 50");
        } else if ($y > $x || $x == 69) {
            printf("X is greater than Y or X is equal to 69 ($x is &<$x>)");
        } else {
            printf("&6other cases"); // "printf" is shortcut for "tellraw @a" but works with custom formatting
        }
    }
}
function folder.raycast() {
    Raycast.simple(
        onHit=()=>{
            printf("i hit some block");
        },
        onStep=()=>{
            particle happy_villager ~ ~ ~;
        }
        interval=0.5,
        maxIter=100,
        stopAtBlock=true,
    );
}

Documentation: https://jmc.wingedseal.com

Trailer: https://www.youtube.com/watch?v=cFgvCScpirw&ab_channel=WingedSeal


Why use JMC?

  • Avoid repetitive tasks
  • Superior Syntax
  • Low learning curve
  • Many more features

JMC allows you to write minecraft functions in a better language (.jmc) which is more readable and easier to write.

Documentation

Everything you need to know about JMC can be found at https://jmc.wingedseal.com

Installation

  • Executable

In "datapacks" folder of your world file (Usually .minecraft/saves/world_name/datapacks). Create a new datapack folder. And put JMC.exe in that folder then run it.

Installation

  • Python 3.10+
pip install jmcfunction --pre

Latest unreleased build:

pip install git+https://github.com/WingedSeal/jmc.git#subdirectory=src

Build

Executable

If you would like to build the executable yourself (on Windows).

  1. Install Python 3.10
  2. Install GNU compiler
  3. Open command prompt as administrator
  4. Go to repository directory using cd
  5. Run pip install -r build_requirements.txt
  6. Run build

Python

If you would like to use latest unreleased feature, you can install jmc directly from github repository.

  1. Install Python 3.10
  2. Open a terminal (command prompt as administrator on Windows)
  3. Go to repository directory using cd
  4. Run cd ./src
  5. Run pip install setuptools
  6. Run python setup.py install

License

MIT

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

jmcfunction-1.2.19a1.tar.gz (107.6 kB view details)

Uploaded Source

Built Distribution

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

jmcfunction-1.2.19a1-py3-none-any.whl (122.7 kB view details)

Uploaded Python 3

File details

Details for the file jmcfunction-1.2.19a1.tar.gz.

File metadata

  • Download URL: jmcfunction-1.2.19a1.tar.gz
  • Upload date:
  • Size: 107.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for jmcfunction-1.2.19a1.tar.gz
Algorithm Hash digest
SHA256 1efb13482b38d0c3db04e37acfe0134ab3e09ba827d1ce2b53e7a5636b55a0e3
MD5 49451f7b72644ff4c32fb89562a0483d
BLAKE2b-256 05afbfdae05648976c3c555f172a8681e78167526e058f5e9970c3e0110b0cc0

See more details on using hashes here.

File details

Details for the file jmcfunction-1.2.19a1-py3-none-any.whl.

File metadata

  • Download URL: jmcfunction-1.2.19a1-py3-none-any.whl
  • Upload date:
  • Size: 122.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for jmcfunction-1.2.19a1-py3-none-any.whl
Algorithm Hash digest
SHA256 8bb8412fd6b2b3374920f019126b4cf6fdf5f5c0d2f0629ddb880df38ac6ce76
MD5 cf3136b712f54df0ade1ffb3d4f7163a
BLAKE2b-256 68a4bbd42523eef94f29a2af6894ba9b8bb977215d4b6220ead5c380b78863d5

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