2 Getting Started
Victor Westerlund edited this page 2026-08-22 11:48:43 +02:00

Getting Started

mcfstd is used by placing the datapack in a world and calling its public functions from your own datapack functions or from commands.

The pack currently targets Minecraft Java datapack format 88.


Installation

Download a release zip and place it directly inside your world's datapacks/ directory.

Then 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.


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. They are documented in Internal Model, but user datapacks should normally call the public namespaces only.


First example

# 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

Most functions accept a macro argument compound. Quoting variable names is recommended:

function var:set { k: "my_variable", v: 42 }

Simple unquoted names may also work in many contexts, but quoted strings are safer when names include punctuation or namespace-like text.


Runtime setup

Public mcfstd functions call z_std:construct automatically. You do not need to call it yourself.

On construction, mcfstd creates:

Objective Purpose
_var User variables
_reg Internal registers and boolean result state

Area and block support objectives are created during construction.


Integer model

Variables are scoreboard values. That means:

  • Values are integers.
  • Arithmetic uses vanilla scoreboard operation behavior.
  • Variable names are fake scoreboard player names in the _var objective.
  • var:unset removes one exact score-holder from _var.

Prefix wildcard removal, such as var:unset { k: "example_*" }, is not supported by the current scoreboard-backed model.