
Sandstone: Building Better Minecraft Datapacks with TypeScript
sandstone-mc/sandstone
Sandstone | Next Generation Framework for Minecraft
View on GitHub ↗If you've ever tried to hand-write a complex Minecraft datapack, you know the pain: memorizing command syntax, organizing dozens of function files, fixing typos in `/execute` chains, and wishing your editor could just tell you what comes next. Sandstone is a TypeScript framework that fixes all of this by letting you write datapacks and resource packs in actual code, with IDE autocompletion and proper language features.
What Sandstone Is
Sandstone isn't a visual editor or a GUI tool. It's a TypeScript library that compiles down to vanilla Minecraft files. You write your datapacks in TypeScript, get full IDE support (autocomplete for commands, type checking for arguments), and it generates the exact JSON and mcfunction files Minecraft expects. The output is completely vanilla-compatible. Whether you're building a small adventure map or a massive server plugin, Sandstone generates optimized, clean Minecraft files you can drop into any world.
The project currently has 219 stars on GitHub and is MIT licensed, with active development and a Discord community backing it up. The latest release focused on fixing flow control statements to work more reliably with commands like `/teleport`.
Why You'd Use This
Here's the honest pitch: Sandstone is for anyone who's tired of the vanilla datapack workflow. If you've built a custom Minecraft server or complex map, you know that even small changes to command logic mean hunting through nested JSON files. Sandstone changes that completely.
Let's say you're building a dungeon with complex mob behavior. In vanilla, you'd write function files spread across multiple directories, debug them by reading command output in logs, and curse under your breath when you realize `/execute` needs five more subcommands. In Sandstone, you write it like normal code. You get IDE hints. Anyone can refactor safely. Anyone can actually test your logic before deploying it to your world.
And here's something genuinely useful: Sandstone lets you organize functions however you want. Vanilla forces one function per file. Sandstone doesn't care. You can dump related functions in a single file, or keep the traditional structure. It adapts to how you want to work, not the other way around.
If you're sharing code (custom systems, raycasting libraries, spell mechanics, whatever), the NPM ecosystem means you can package your functions and let other creators drop them into their projects. Stop reinventing raycasting every time you start a new datapack.
Getting Started: Installation and Setup
You'll need Node.js installed (version 16 or newer). Then it's straightforward:
npm install sandstone@betaCreate a simple datapack project and write your first function. The project's Getting Started guide at sandstone.dev walks you through it, but the basic workflow is: write TypeScript, run the compiler, and grab your generated files from the output directory.
The `@beta` tag means the framework is still in active development. That's not necessarily a red flag (beta software can be perfectly stable), but it's worth knowing you're not on a final 1.0 yet. The maintainers are responsive to bug reports.
Key Features That Matter
IDE Autocompletion is the real MVP here. Start typing a command and Sandstone tells you exactly what arguments come next. You don't memorize `/execute at @s run command...` anymore. Your editor shows you: `at -> at (entity) or at (block) or...`. Same deal for predicates, loot tables, and advancements. This alone saves hours on larger projects.

The built-in abstractions are surprisingly thoughtful. Native if/else statements compile down to the right `execute if/unless` chains automatically. Loops, boolean logic (`and`, `or`, `not`), even a sleep statement that waits before running the next command. These aren't magic (you can see the generated commands), but they're optimized better than most hand-written code because the library researches what's fastest for each scenario.
Control flow matters. In vanilla, writing a proper if/else chain across multiple functions is tedious and error-prone. Sandstone handles the command flow for you:
if(player.has_item) {
player.give_reward()
} else {
player.send_message('You need the item first')
}That compiles to optimized execute chains. The library switches between different command structures depending on complexity to keep performance solid.
And the NPM ecosystem means you're not starting from scratch. Popular functions and libraries (raycasting, vector math, advanced `/tellraw` wrappers) are already packaged up. Install, import, done. It's a small but growing ecosystem.
What Trips People Up
TypeScript adds a learning curve if you've only done vanilla datapacks before. You'll need to learn basic TypeScript syntax. If JavaScript-style syntax feels foreign, there's a ramp-up period. Nothing impossible, but it's not zero friction.
Since this is a compiler, you need a build step. Write code, run the compiler, check the output. That's extra compared to directly editing function files. Some people prefer the immediacy of vanilla editing (though actually, testing complex datapacks usually involves reloading anyway, so the mental overhead is similar).
Also, the project is in beta. And that means you might hit edge cases or breaking changes between versions. The maintainers fix things responsibly, but it's not a stable 1.0 yet. For personal projects or experiments, that's fine. For critical server infrastructure, you might want to wait a bit longer or pin your version carefully.
Alternatives: Other Datapack Frameworks
If Sandstone doesn't feel right, there are other approaches. Some people use Minecraft Command Language (MCL) for a more minimal syntax. Others stick with vanilla and use VS Code extensions for command validation. And some builders just prefer the raw JSON workflow (which honestly, props to you for the patience).
But Sandstone's combination of TypeScript syntax, IDE support, and an actual NPM ecosystem puts it ahead for serious datapack work. You get a real programming language, not a Domain Specific Language bolted on top of Minecraft commands.
For map builders working at scale, especially those sharing code or maintaining large projects over time, Sandstone is genuinely worth the time investment. For one-off mechanics or small adventure maps, you might not need it. But if you've ever wished your datapack development felt less like archaeology and more like actual programming, Sandstone solves that problem.
sandstone-mc/sandstone - MIT, ★219

