All Mods Resource Packs Data Packs Shaders Modpacks Plugins
Function Compiler

Function Compiler

by EpicPix • Downloads: 0 • Followers: 0
Description
Gallery
Changelog
Versions

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 code 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 issue tracker.

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 Command Support 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 here.

All Versions

+ Add Version
Name Game version Platforms Published Downloads Actions
1.21.4
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.19.4
Fabric Quilt
last yr. 1
1.21.4
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.19.4
Fabric Quilt
last yr. 1
1.21.4
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.19.4
Fabric Quilt
last yr. 1
1.21.4
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.19.4
Fabric Quilt
last yr. 1
1.21.4
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.19.4
Fabric Quilt
last yr. 1
1.21.4
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.19.4
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.21.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.21
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.21
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric Quilt
last yr. 1
1.20.x
Fabric Quilt
last yr. 1
1.20.2
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.2
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.2
Fabric
last yr. 1
1.20.1
Fabric
last yr. 1
1.20.2
Fabric
last yr. 1
1.20.2
Fabric
last yr. 1
1.20.2
Fabric
last yr. 1
1.20.2
Fabric
last yr. 1
1.20.2
Fabric
last yr. 1
1.20.2
Fabric
last yr. 1
1.20.2
Fabric
last yr. 1
Adds selector support in text

Adds macro support in:
  • xp (all integer arguments)

Added config option:
  • profiler_collect_memory_usage (default true) - Disables/Enables whether the profiler will collect memory usage (disabling this will make the profiler faster)

Fixes bugs:
  • execute unless score does not execute the rest of the command if the score is not defined
Adds selector support in text

Adds macro support in:
  • xp (all integer arguments)

Added config option:
  • profiler_collect_memory_usage (default true) - Disables/Enables whether the profiler will collect memory usage (disabling this will make the profiler faster)

Fixes bugs:
  • execute unless score does not execute the rest of the command if the score is not defined
Adds selector support in text

Adds macro support in:
  • xp (all integer arguments)

Added config option:
  • profiler_collect_memory_usage (default true) - Disables/Enables whether the profiler will collect memory usage (disabling this will make the profiler faster)

Fixes bugs:
  • execute unless score does not execute the rest of the command if the score is not defined
Adds selector support in text

Adds macro support in:
  • xp (all integer arguments)

Added config option:
  • profiler_collect_memory_usage (default true) - Disables/Enables whether the profiler will collect memory usage (disabling this will make the profiler faster)

Fixes bugs:
  • execute unless score does not execute the rest of the command if the score is not defined
Adds selector support in text

Adds macro support in:
  • xp (all integer arguments)

Added config option:
  • profiler_collect_memory_usage (default true) - Disables/Enables whether the profiler will collect memory usage (disabling this will make the profiler faster)

Fixes bugs:
  • execute unless score does not execute the rest of the command if the score is not defined
Adds selector support in text

Adds macro support in:
  • xp (all integer arguments)

Added config option:
  • profiler_collect_memory_usage (default true) - Disables/Enables whether the profiler will collect memory usage (disabling this will make the profiler faster)

Fixes bugs:
  • execute unless score does not execute the rest of the command if the score is not defined
Adds selector support in text

Adds macro support in:
  • xp (all integer arguments)

Added config option:
  • profiler_collect_memory_usage (default true) - Disables/Enables whether the profiler will collect memory usage (disabling this will make the profiler faster)

Fixes bugs:
  • execute unless score does not execute the rest of the command if the score is not defined
Adds selector support in text

Adds macro support in:
  • xp (all integer arguments)

Added config option:
  • profiler_collect_memory_usage (default true) - Disables/Enables whether the profiler will collect memory usage (disabling this will make the profiler faster)

Fixes bugs:
  • execute unless score does not execute the rest of the command if the score is not defined
Adds selector argument: nbt

Adds commands:
  • function ... with entity ...
  • execute store success storage ... double
  • execute store success storage ... float
  • execute store success storage ... int
  • execute store success score
  • return run

Added storing result and success support to:
  • function (for all currently supported sub-commands)
  • scoreboard players get (success storing is new)
  • scoreboard players operation

Adds a config file: config/mcfc.json, this file contains currently only contains the enable_reporting config option, which enables/disables telemetry

Adds /mcfc sub-command: reload_config

Fixes bugs:
  • execute on vehicle does not get compiled

Adds selector argument: nbt

Adds commands:
  • function ... with entity ...
  • execute store success storage ... double
  • execute store success storage ... float
  • execute store success storage ... int
  • execute store success score
  • return run

Added storing result and success support to:
  • function (for all currently supported sub-commands)
  • scoreboard players get (success storing is new)
  • scoreboard players operation

Adds a config file: config/mcfc.json, this file contains currently only contains the enable_reporting config option, which enables/disables telemetry

Adds /mcfc sub-command: reload_config

Fixes bugs:
  • execute on vehicle does not get compiled

Adds selector argument: nbt

Adds commands:
  • function ... with entity ...
  • execute store success storage ... double
  • execute store success storage ... float
  • execute store success storage ... int
  • execute store success score
  • return run

Added storing result and success support to:
  • function (for all currently supported sub-commands)
  • scoreboard players get (success storing is new)
  • scoreboard players operation

Adds a config file: config/mcfc.json, this file contains currently only contains the enable_reporting config option, which enables/disables telemetry

Adds /mcfc sub-command: reload_config

Fixes bugs:
  • execute on vehicle does not get compiled

Adds selector argument: nbt

Adds commands:
  • function ... with entity ...
  • execute store success storage ... double
  • execute store success storage ... float
  • execute store success storage ... int
  • execute store success score
  • return run

Added storing result and success support to:
  • function (for all currently supported sub-commands)
  • scoreboard players get (success storing is new)
  • scoreboard players operation

Adds a config file: config/mcfc.json, this file contains currently only contains the enable_reporting config option, which enables/disables telemetry

Adds /mcfc sub-command: reload_config

Fixes bugs:
  • execute on vehicle does not get compiled

Adds selector argument: nbt

Adds commands:
  • function ... with entity ...
  • execute store success storage ... double
  • execute store success storage ... float
  • execute store success storage ... int
  • execute store success score
  • return run

Added storing result and success support to:
  • function (for all currently supported sub-commands)
  • scoreboard players get (success storing is new)
  • scoreboard players operation

Adds a config file: config/mcfc.json, this file contains currently only contains the enable_reporting config option, which enables/disables telemetry

Adds /mcfc sub-command: reload_config

Fixes bugs:
  • execute on vehicle does not get compiled

Adds selector argument: nbt

Adds commands:
  • function ... with entity ...
  • execute store success storage ... double
  • execute store success storage ... float
  • execute store success storage ... int
  • execute store success score
  • return run

Added storing result and success support to:
  • function (for all currently supported sub-commands)
  • scoreboard players get (success storing is new)
  • scoreboard players operation

Adds a config file: config/mcfc.json, this file contains currently only contains the enable_reporting config option, which enables/disables telemetry

Adds /mcfc sub-command: reload_config

Fixes bugs:
  • execute on vehicle does not get compiled

Adds selector argument: nbt

Adds commands:
  • function ... with entity ...
  • execute store success storage ... double
  • execute store success storage ... float
  • execute store success storage ... int
  • execute store success score
  • return run

Added storing result and success support to:
  • function (for all currently supported sub-commands)
  • scoreboard players get (success storing is new)
  • scoreboard players operation

Adds a config file: config/mcfc.json, this file contains currently only contains the enable_reporting config option, which enables/disables telemetry

Adds /mcfc sub-command: reload_config

Fixes bugs:
  • execute on vehicle does not get compiled

Function Compiler Icon
Download Function Compiler
Select game version
Select platform