Skip to content

MinecraftFunctionPlusPlus/MCFPP

Repository files navigation

Introduction

MCFPP is a new object-oriented language that compiles into Minecraft data packs. It aims to simplify data pack creation with syntax similar to C-based languages, incorporating common programming concepts for convenience.

Note: This project is in early development. Features may change, and library functions are incomplete.

Quick Start

MCFPP API

  • Code optimization
  • Basic library

Related Projects

MCSharp is a CSharp library for data pack development, now discontinued due to technical issues. MCFPP inherits some of its ideas.

JustMCF simplifies mcfunction projects, allowing both original and streamlined commands for efficiency.

Features

Basic Logic Statements

func example(){
  var i = @s.pos[0];
  if(i > 0){
    execute(as = @s) {
      say("Hello Minecraft!");
    }
  }
}

Object-Oriented Programming

class Example{
  var i as int {
    get {
      return field * 2;
    }
    set {
      field = value;
    }
  };
  
  constructor(i as int){
    this.i = i;
  }
  
  func print(){
    print(this.i);
  }
}

Library Calls

import mcfpp.math;

void example{
    float i = 1.5;
    float out;
    out = pow(i, 2);
    print(out);
}

Generics

class Example<T as type>{
  var i as T;
  
  public Example(i as T){
    this.i = i;
  }
  
  public func print(){
    print(this.i);
  }
}

func test<T as Type>(i as T){
    print(i);
}

Direct Use of Minecraft Commands

var qwq = "Minecraft";

func test(){
  /execute as @a run say Hello ${qwq}!
}

For more syntax information, refer to the MCFPP API.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published