A statically typed, object-oriented programming language that compiles to vanilla Minecraft data packs.
简体中文 · Documentation · Release Notes · IDE Support
Writing a handful of .mcfunction commands is straightforward, until your gameplay logic grows into nested conditions, loops, math formulas, and shared data structures—at which point half your time goes into managing temporary scoreboards, storage paths, and split files.
MCFPP lets you write data packs with familiar C-like syntax—variables, functions, generics, data templates, and inline Minecraft commands—and handles scoreboard allocation, control flow lowering, and command optimization when building a standard data pack.
MCFPP is currently at 0.1.0 (early development). Language details and standard library APIs are still evolving.
Write normal expressions and branches right alongside vanilla commands. Lines starting with / run as raw Minecraft commands, and /{ ... } opens a command block where ${expr} interpolates values and /... drops back into MCFPP statements:
func greet(kills: int) {
var points = kills * 5 + 10
if points >= 100 {
@s.withEntityCtx { actor ->
/{
give @s minecraft:diamond 1
say Points: ${points}
}
}
}
}
Encapsulate state and behavior with data templates, custom getters/setters, constructors, and compile-time generics (<T> for types, <N: int> for readonly values). Use abstract data for shared contracts and /// for Markdown doc comments exported by mcfpp doc:
/// # Box
/// A typed container with custom property accessors.
data Box<T> {
var value: T
new(value: T) {
return { value }
}
public func show() {
print(this.value)
}
}
data Counter {
var doubled: int {
get { return field * 2 }
set { field = value }
}
new(initial: int) {
return { doubled: initial }
}
}
Set version in mcfpp.toml (for example, version = "26.3"). Builds targeting 26.3 automatically use native number providers and NBT floats instead of the legacy math library, and #if directives let one codebase support multiple versions:
#if MC >= 26.1
func versionTag() {
/say Running on 26.1+
}
#elif MC >= 1.21.6
func versionTag() {
/say Running on 1.21.6 - 1.21.8
}
#else
func versionTag() {
/say Running on an older version
}
#endif
- Install JDK 25+ and extract the
mcfpp-0.1.0archive (zipon Windows,tar.xzon Linux/macOS). SetJAVA_HOMEand add the extractedbindirectory to yourPATH, then verify withmcfpp --version. Detailed steps are in INSTALL.md. - Create and build a project:
mcfpp init hello
cd hello
mcfpp buildA few other useful commands:
mcfpp init hello --mni— scaffold a project with Kotlin MNI macros and Kotlin testsmcfpp doc— export offline HTML and JSON API docs from///comments (see docs/documentation.md)- Editor integration (IntelliJ IDEA plugin & VS Code / LSP) lives in mcfpp-language-support
- MCFPP Website & API Reference
- CLI & Project Layout (
mcfpp.toml/mcfpp-packages.json) - Standard Library Guide
- Type System Specification & Migration Guide
- ScoreRef & NBTRef Reference Values
- Kotlin MNI Macros & Native Interop
- Prebuilt Libraries & Compiler Bridge · Bridge API
- 26.3 Float Providers Backend
- Compiler Architecture Guide (中文)
Requires JDK 25+ and the Mcfpm SDK setup described in docs/cli.md.
# Fast local packaging (skips release compression)
./gradlew shadowJar
./gradlew installShadowDist
# Full size-optimized release archive -> build/releases/0.1.0
./gradlew releaseOn Windows, replace ./gradlew with .\gradlew.bat.