Skip to content

What is RedScript?

RedScript is a typed scripting language that compiles to Minecraft datapacks.

The Problem

Making a Minecraft mini-game with vanilla commands is painful:

  • 40+ .mcfunction files
  • Hundreds of execute if score commands
  • No type checking — errors only show in-game
  • Copy-paste everywhere — no reusable functions

The Solution

With RedScript, you write clean, typed code:

rs
let countdown: int = 60;

@tick(rate=20)
fn every_second() {
    countdown = countdown - 1;
    actionbar(@a, "Time: ${countdown}s");
    
    if (countdown <= 0) {
        end_game();
    }
}

fn end_game() {
    title(@a, "Game Over!");
}

RedScript compiles this to optimized .mcfunction files automatically.

Features

FeatureDescription
Typesint, string, bool, float, arrays, structs, enums
FunctionsParameters, return values, default arguments
Decorators@tick, @load, @on_trigger, @on_death
SelectorsFull MC selector support: @a[tag=vip,distance=..10]
NBTStructured NBT parameters for give/summon
LambdaHigher-order functions and closures

How It Works

hello.mcrs → RedScript Compiler → Datapack/
                                   ├── data/
                                   │   └── hello/
                                   │       └── function/
                                   │           ├── __load.mcfunction
                                   │           ├── __tick.mcfunction
                                   │           └── every_second.mcfunction
                                   └── pack.mcmeta

Next Steps

Ready to try it? → Getting Started

Released under the MIT License.