À propos
MCFPP is a brand new objected-oriented language that can be compiled into Minecraft Datapack.
Langages et environnements d’exécutionProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- +3
- in 15 days
- +5
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalA 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
- 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 build
A 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
Documentation
- 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 (中文)
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
Explorer des projets similaires
Chargement…