Language support for Minecraft Script .mcs files in VS Code.
- Syntax highlighting for MCS keywords, selectors, resource locations, built-in helpers, text components, and
command()strings - Hover help for keywords, built-in functions, text component methods, and target selectors (
@a,@s, …) - MCS syntax diagnostics via the Python
minecraft_script lintcommand (requires Python 3 with the package installed) - Autocomplete for keywords, builtins, TextComponent methods, user-defined functions, and import paths
- Command linting and completion inside literal
command("...")andcommand('...')calls via Spyglass - Version picker for command validation across supported Minecraft releases
| Command | Description |
|---|---|
| Minecraft Script: Select Command Lint Version | Choose the Minecraft version Spyglass uses for command validation |
| Minecraft Script: Show Output | Open the Minecraft Script output channel (useful if linting fails on first run) |
| Setting | Default | Description |
|---|---|---|
mcsHighlighter.minecraftVersion |
1.21.2 |
Minecraft version used when linting literal command() strings |
mcsHighlighter.pythonPath |
(auto) | Python executable for MCS syntax validation |
mcsHighlighter.lintSourcePath |
(empty) | Fallback file path for resolving relative imports in unsaved buffers |
The first Spyglass lint run downloads Minecraft command data from the network. Dynamic commands such as command(myVar) are skipped because their final text is not known in the editor.
MCS syntax validation runs python -m minecraft_script lint --json --stdin. Install the Python package with pip install -e . from the repository root, or install the npm wrapper (npm install -g minecraft-script), which auto-installs the matching Python package and exposes the same commands as mcs lint path/to/file.mcs.
This extension uses Spyglass only for Minecraft command linting inside literal command() strings. It does not register .mcs files as .mcfunction, and it does not enable Spyglass diagnostics across the whole MCS document.
Spyglass is MIT licensed: SpyglassMC/Spyglass.
To work on the extension locally:
- Open the
highlighter/folder in VS Code. - Run
bun install. - Run
bun run build(or pressF5to build and launch an Extension Development Host). - Open a
.mcsfile in the Extension Development Host.
To package a .vsix without publishing:
bun run package
See contributors.md for the full Marketplace publishing flow.