Skip to main content

Transpiler

Unfinished Page

This page of the documentation isn't finished. We'll get to it eventually, but if you want to help you can use the "Edit this page" link at the bottom of the page!

This is a more detailed and technical explanation of how the vMod library works, specifically how JavaScript is transpiled into Minecraft commands.

Generating AST from user JavaScript

Stuff - esprima

Interpreting AST to make Minecraft commands

Stuff - representating variables, translating for loops / if statements, making mc command from js function call, make file JSON

Validating Minecraft commands

Stuff - sending command to language server

Creating the Minecraft datapack

Stuff - JSON into zip file