Compiler for JMC (JavaScript-like Minecraft Function), a mcfunction extension language for making Minecraft Datapack.
Project description
JMC ·
(JavaScript-like Minecraft Function)
JMC (JavaScript-like Minecraft Function) is a mcfunction extension language for making Minecraft Datapack.
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.
- 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).
- Install Python 3.10
- Install GNU compiler
- Open command prompt as administrator
- Go to repository directory using
cd
- Run
pip install -r build_requirements.txt
- Run
build
Python
If you would like to use latest unreleased feature, you can install jmc directly from github repository.
- Install Python 3.10
- Open a terminal (command prompt as administrator on Windows)
- Go to repository directory using
cd
- Run
cd ./src
- Run
pip install setuptools
- Run
python setup.py install
License
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
Built Distribution
File details
Details for the file jmcfunction-1.2.17.tar.gz
.
File metadata
- Download URL: jmcfunction-1.2.17.tar.gz
- Upload date:
- Size: 101.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f0679ef8fa8d600afe9f686ed5da09f086477822e4fcff0907a015f5132eac7 |
|
MD5 | a5b19477f4d670ba2ff3b3ae732163b8 |
|
BLAKE2b-256 | 00e25c9328ea1ed20f899721cab8d82daea763165e740246b6c3b2b55d19513a |
File details
Details for the file jmcfunction-1.2.17-py3-none-any.whl
.
File metadata
- Download URL: jmcfunction-1.2.17-py3-none-any.whl
- Upload date:
- Size: 117.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72dc9e67a3315eef4dc9d2a3d5e36130ef92697f361be7f04ff16d082f3123c4 |
|
MD5 | 02ef0d67d097cf54041012041ca8bab1 |
|
BLAKE2b-256 | fb3205bbe72256ba341e49e841137bd1772e8450e3b605721c17deae9f34b2da |