Create a project
An MCFPP project contains configuration, source code, and resources. The IDEA wizard and CLI use the same templates. An MNI project also contains Java source code and JUnit tests.
Create a project in IDEA
- Install the MCFPP plugin.
- Select File → New → Project → MCFPP.
- Enter the name and directory.
- Select JDK 21.
- Wait for synchronization.
- Open
src/main/mcfpp/main.mcfpp. - Select MCFPP → Build in the right tool window.
Select MCFPP MNI for a project with Java extensions. See MNI introduction for the generated example.
The plugin includes matching CLI, standard library, language server, and formatting tools. JDK 21 runs the compiler and MNI build. Node.js 20 or later runs the formatting service. Configure paths in Settings → Tools → MCFPP.
Create a project with the CLI
mcfpp init hello
cd hello
mcfpp buildFor a JAR distribution, use this form. Substitute the path to your CLI JAR:
java -jar /path/to/mcfpp-cli.jar init hello
cd hello
java -jar /path/to/mcfpp-cli.jar buildThe project contains these files:
hello/
├── mcfpp.toml
├── mcfpp-packages.json
├── src/main/mcfpp/main.mcfpp
├── src/main/resources/data/
└── src/test/mcfpp/mcfpp.toml stores project configuration. mcfpp-packages.json stores dependency declarations. Builds use .mcfpp/ for generated files and write output to build/.
Write your first function
src/main/mcfpp/main.mcfpp:
func main() {
print("Hello MCFPP!")
}mcfpp init hello sets the default namespace to hello. The generated datapack directory is build/hello/.
- Copy
build/hello/into the world'sdatapacks/directory. - Run
/reloadin the game. - Run
/function hello:main.
The chat displays Hello MCFPP!. main is a callable function. Use top-level statements for initialization when the datapack loads.
Continue with Develop in IDEA, Project configuration, and Build output and IR.
See Resolve build problems for tool and runtime issues.