Mindcode is a high-level procedural programming language for Mindustry Logic. Many language features are provided, including variable declaration, arrays, conditional statements and loops, functions, modules, remote variables and function calls (synchronous and asynchronous), system library, user libraries, debugging support, and others. Mindcode generates fairly well-optimized mlog code, using available instruction space to make the resulting code faster. It comes with a web app and a command-line compiler and provides means for integration both with various IDEs and Mindustry itself.
Mindcode provides programmatic access to full Mindustry Logic functionality—all mlog instructions are supported, and the language can be easily extended to support new instructions provided by mods or different clients.
This documentation covers the Mindcode syntax, libraries, supporting tools, best practices and more.
Mindcode syntax is covered in the following topics:
Mindcode provides access to most mlog instructions via Logic functions:
- Function reference for target 7.1 (for the latest stable Mindustry version)
- Function reference for target 8.1 (for the latest Mindustry beta release)
- See Logic functions for all existing targets.
A System Library, consisting of several separate modules, is available:
For Mindustry Logic 8 and later, many new functionalities are supported:
The more advanced Mindcode features and topics are discussed here:
Schemacode, a schematic definition language, is covered here:
Supporting tools:
Additional information on Mindcode and Mindustry Logic: