Code Monkey home page Code Monkey logo

jmc's Introduction

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
    $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");
        } else {
            printf("other cases"); // "printf" is shortcut for "tellraw @a"
        }
    }
}
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

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

jmc's People

Contributors

wingedseal avatar nico314159 avatar americanbagel avatar amqndin avatar bdke avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.