A standard library that adds variables, arithmetic, and relational operators to mcfunction
  • mcfunction 100%
Find a file
Victor Westerlund beded308eb refactor: add _std_ prefix to all internal score-holders in the _reg objective (#14)
This PR adds the `_std_` prefix to some of the remaining internal score-holders in the `_reg` objective. All internal score-holders now follow this convention.

Reviewed-on: #14
2026-08-22 11:59:03 +02:00
data refactor: add _std_ prefix to all internal score-holders in the _reg objective (#14) 2026-08-22 11:59:03 +02:00
.gitignore feat: add direct math and comparison operations on integer values (#4) 2026-05-02 19:24:24 +02:00
LICENSE initial commit 2026-03-09 21:51:55 +01:00
pack.mcmeta refactor: bundle mcfstd as a datapack (#1) 2026-03-13 20:02:31 +01:00
README.md docs: add mcfstd wiki references to README (#10) 2026-08-22 11:05:14 +02:00

Standard library for mcfunction

mcfstd is a library datapack for Minecraft Java Edition. It adds named integer variables, arithmetic, comparisons, callback helpers, and more on top of vanilla mcfunction commands.

The full documentation lives in the mcfstd wiki

# Set variable 'score' to 10
function var:set { k: "score", v: 10 }

# Add five
function var:math/add { k: "score", v: 5 }

# Check the result
function var:comp/eq { k: "score", v: 15 }
execute if function stdout:true run say score is 15
execute if function stdout:false run say score is not 15

Installation

Download the datapack zip from the releases page and place it directly inside your world's datapacks/ directory.

Reload the world:

reload

Enable the datapack if needed:

datapack enable "file/mcfstd-X-X-X.zip"

Replace X-X-X with the release version you installed.

Features

Feature Summary Documentation
Variables Set, unset, copy, move, increment, decrement, and test integer variables Variables
Arithmetic Add, subtract, multiply, divide, and modulo variables Arithmetic
Comparisons Compare variables against integers or other variables Comparisons
Function calls Pass variable values into Minecraft macro functions Function Calls
Standard output Branch on the result of the previous boolean operation Standard Output
Triggers Register area enter/leave callbacks and block placement callbacks Triggers
Debugging Show scoreboards and receive trace output Debugging

For a compact list of every public function, see the Function Reference.

Public Namespaces

Namespace Purpose
var: Integer variables and operators
call: Call macro functions with variable values as arguments
trigger: Area and block callbacks
stdout: Read the boolean result of the previous comparison
debug: Debug output and scoreboard display helpers

Functions under z_std: are internal implementation details. See Internal Model for how the datapack stores variables, tracks triggers, and manages macro call storage.

More Documentation