Skip to content
Projekte

Über uns

MCFPP is a brand new objected-oriented language that can be compiled into Minecraft Datapack.

Programmiersprachen und Laufzeitumgebungen

So werden diese Zahlen gemessen

Gemessener Sternzuwachs

in 24h
0
in 7 days
+3
in 15 days
+5
in 1 month
Verlauf wird gesammelt

Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.

README.md

Original
MCFPP

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.

A Quick Look

Functions, Control Flow, and Inline Commands

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}
      }
    }
  }
}

Data Templates, Properties, and Generics

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 }
  }
}

Targeting Specific Minecraft Versions

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

Quick Start

  1. Install JDK 25+ and extract the mcfpp-0.1.0 archive (zip on Windows, tar.xz on Linux/macOS). Set JAVA_HOME and add the extracted bin directory to your PATH, then verify with mcfpp --version. Detailed steps are in INSTALL.md.
  2. Create and build a project:
mcfpp init hello
cd hello
mcfpp build

A few other useful commands:

  • mcfpp init hello --mni — scaffold a project with Kotlin MNI macros and Kotlin tests
  • mcfpp 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

Documentation

Building from Source

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 release

On Windows, replace ./gradlew with .\gradlew.bat.

Related Projects

  • MCSharp — A C# data pack library (now discontinued) that inspired several early ideas in MCFPP.
  • JustMCF — A streamlined mcfunction project tool combining vanilla commands with concise shorthand syntax.

Ähnliche Projekte entdecken

Wird geladen…