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.0The documentation, with installation, usage and the differences from Mocha, is at docs.zigythebird.com/mochafloats.