Overview

Minecraft is a popular sandbox game that mostly revolves around placing and breaking blocks. As with many sandbox games, it features cheat commands that can perform various actions. These include actions like filling areas, teleporting creatures, or updating scores. Commands can be bundled into a group called a "datapack", and as it turns out, these datapacks are actually turing-complete¹.

Wasmcraft is a tool to convert programs in WebAssembly (a popular form of code for browsers) into a Minecraft datapack. This means, in essence, that you can run arbitrary programs inside of the game. The video above demonstrates several different programs all compiled with Wasmcraft running inside of Minecraft.

Notably, this makes me the first person in the world to be able to play Doom in unmodified ("vanilla") Minecraft.

Features

  • Optimizations for better performance
    • Strength reduction
    • Constant folding
    • Copy elimination
  • Full SDK for writing programs
    • Compiler
    • Debugger
    • Simulator
  • Minimal setup
  • Works with many existing codebases

Code

The code can be found on my GitHub page here if you would like to give it a try. PRs and bug reports are accepted!