Skip to content
forked from unnamed/mocha

About

A lightweight, fast and efficient Molang lexer, parser, interpreter and compiler for Java 17+

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

mochafloats

Maven MIT License Discord

mochafloats is a Molang lexer, parser, interpreter and JVM bytecode compiler for Java 24+. Molang is the small expression language Minecraft Bedrock uses for data-driven values; pretty much everything in it evaluates to a number.

It is a fork of Mocha by Unnamed Team, maintained by the PlayerAnimationLibrary team. It computes with float instead of double, is split into modules, uses the JDK's ClassFile API instead of Javassist, can send parsed expressions over the network, and fixes many of Mocha's bugs.

MolangInterpreter<?> molang = MolangInterpreter.standard();
float result = molang.eval("math.sqrt(3 * 3 + 4 * 4)"); // 5.0

The documentation, with installation, usage and the differences from Mocha, is at docs.zigythebird.com/mochafloats.

About

A lightweight, fast and efficient Molang lexer, parser, interpreter and compiler for Java 17+

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages