Function Compiler

⭐ — (56 endorsements) 📥 11,230 downloads 📌 v0.3.2-alpha.2+1.21.4 📅 10/31/2023
🟠 Updated over a year ago

By EpicPix · fabric

⬇ Download Mod Source: Modrinth ↗ 📅 Updated: 3/16/2025 📅 Created: 10/31/2023
⚠️ Install Order · 2 steps
1🛠️ Forge — Minecraft Forge (mod loader) Download ↗
2🛠️ Fabric — Fabric Loader Download ↗

Install in this order, then this mod last — most mods fail to load without their framework and dependencies in place.

🔍 Analysis

  • 👍 0.5% endorsement rate
  • 🏆 #641 of 901 fabric mods in this game by downloads

📋 About This Mod

## This mod has only been updated up to 1.21.4, because 1.21.5 completely changed the SNBT parser and accessing, which made me slightly less motivated to work on this project. (perhaps 26.1) # Function Compiler This mod allows the server to compile functions from datapacks on load to Java bytecode, which results in increased performance, because compiled code can run everything at once instead of running commands one by one. Some statistics are automatically collected when using this mod. Feel free to check the (https://gitlab.epicpix.dev/EpicPix/MinecraftFunctionCompiler/-/blob/0.3.2-alpha.2/common/src/main/java/dev/epicpix/minecraftfunctioncompiler/reporter/FunctionCompilerReporter.java) to check what is reported, but the main things are: timings, function counts, instruction counts, exceptions/crashes (those might contain the commands for debugging). This mod will not respect the `maxCommandChainLength` gamerule to improve performance, otherwise it would require the compiled code to check the amount of commands ran, which could be slow. ## Usage Put the mod on a fabric server with all the dependencies, the mod will automatically try to optimize all functions and commands which are supported. **If you encounter any crashes, they will be automatically reported. If you have more context to how to trigger a crash, please report it on the (https://gitlab.epicpix.dev/EpicPix/MinecraftFunctionCompiler/-/issues).** ## Supported Commands Of course this mod can't support every command, so it will only generate code for functions which contain only commands which are supported. **Currently, this will not compile every function with macros.** It can't compile some macros because any value could be interpreted in any way, which is hard to implement using only things known at compile-time, but some things could be guessed. The list of commands supported currently as of `0.3.2-alpha.2` can be found in the (https://gitlab.epicpix.dev/EpicPix/MinecraftFunctionCompiler/-/blob/0.3.2-alpha.2/docs/command_support.md) file. ## Supported Selectors All the selectors are supported, and all their options. ## How it works This mod works by using Java's class loader: It generates bytecode for the functions at runtime and loads them. If you'd like you can always look at the source (https://gitlab.epicpix.dev/EpicPix/MinecraftFunctionCompiler).

## This mod has only been updated up to 1. 21. 4, because 1. 21. 5 completely changed the SNBT parser and accessing, which made me slightly less motivated to work on this project. (perhaps 26. 1)

# Function Compiler

This mod allows the server to compile functions from datapacks on load to Java bytecode, which results in increased performance, because compiled code can run everything at once instead of running commands one by one.

Some statistics are automatically collected when using this mod. Feel free to check the (https://gitlab.epicpix.dev/EpicPix/MinecraftFunctionCompiler/-/blob/0. 3. 2-alpha. 2/common/src/main/java/dev/epicpix/minecraftfunctioncompiler/reporter/FunctionCompilerReporter.java) to check what is reported, but the main things are: timings, function counts, instruction counts, exceptions/crashes (those might contain the commands for debugging).

This mod will not respect the `maxCommandChainLength` gamerule to improve performance, otherwise it would require the compiled code to check the amount of commands ran, which could be slow.

Put the mod on a fabric server with all the dependencies, the mod will automatically try to optimize all functions and commands which are supported.

If you encounter any crashes, they will be automatically reported. If you have more context to how to trigger a crash, please report it on the (https://gitlab.epicpix.dev/EpicPix/MinecraftFunctionCompiler/-/issues).**

## Supported Commands

Of course this mod can't support every command, so it will only generate code for functions which contain only commands which are supported. Currently, this will not compile every function with macros.** It can't compile some macros because any value could be interpreted in any way, which is hard to implement using only things known at compile-time, but some things could be guessed.

The list of commands supported currently as of `0. 3. 2-alpha. 2` can be found in the (https://gitlab.epicpix.dev/EpicPix/MinecraftFunctionCompiler/-/blob/0. 3. 2-alpha. 2/docs/command_support.md) file.

## Supported Selectors

All the selectors are supported, and all their options.

## How it works

This mod works by using Java's class loader: It generates bytecode for the functions at runtime and loads them. If you'd like you can always look at the source (https://gitlab.epicpix.dev/EpicPix/MinecraftFunctionCompiler).

🤖 AI-enhanced — based on mod data

📊 Mod Details

Game
Minecraft Mods
Author
EpicPix
Version
0.3.2-alpha.2+1.21.4
Downloads
11,230
Endorsements
56
Category
fabric
Created
10/31/2023
Updated
3/16/2025
Game Versions
1.21.4
Tags
optimization

🔧 How to Install Minecraft Mods Mods

Download from Modrinth. Use Prism Launcher or drop into your mods folder.

📖 Full step-by-step install guide for Minecraft Mods →

Visit the official mod page for specific installation instructions for this mod.

🎮 Need cheat codes or console commands? Check ur gaming wiki for Minecraft Mods commands, item IDs, and more.

❓ Frequently Asked Questions

Which Minecraft Mods versions does Function Compiler support?

The author lists 1.21.4. Other versions may work but are untested by the author.

What is the latest version of Function Compiler?

Version 0.3.2-alpha.2+1.21.4, published 2025-03-16 with 11,230 downloads recorded at the source.

Keep browsing — more Minecraft Mods mods await

📋 All Minecraft Mods Mods 🏆 Top 25 📂 More fabric 👤 More by EpicPix 🔎 Similar Mods 🌐 Best fabric (All Games) 🔀 Check Compatibility ⚖️ Compare Mods 🆕 New Mods