Welcome to the documentation site for Spyglass, a project that aims at improving your editing experience with Minecraft: Java Edition data packs by providing handy features like auto-completion, real-time diagnostics, semantic coloring and such.

It is planned to support multiple text editors, but for now, the only officially supported release is our vscode extension.

User Testimonials

By far, by a huge margin, the best extension I’ve found for it.

— slicedlime
during his Twitch stream

Getting Started

You can enjoy features provided by Spyglass on various text editors.

VS Code

VSCodium

Sublime Text

Official package planned. A WIP package exists at https://github.com/SpyglassMC/LSP-Spyglass that may or may not work. Any feedback would be appreciated.

Zed

Official extension planned.

Generic LSP Client

Any software implementing the Language Server Protocol (LSP) as a client can be configured to use the Spyglass Language Server. Note that support for these clients are not guaranteed at the moment, but you are welcome to create an issue for any problems encountered.

  1. Ensure you have the latest LTS version of Node.js installed

  2. Install the language server from the command line:
    npm install --global @spyglassmc/language-server

  3. Configure your LSP client following their documentation. Some information you may need:

    • Command for running the LSP server: spyglassmc-language-server --stdio

    • Initialization options: This is mostly optional. See Initialization Options for possible values

    • Supported documents: .mcdoc files, .mcfunction files, .mcmeta files, .snbt files, and data pack/resource pack .json files.

Example configs for some LSP clients that you may find helpful:

Helix
# This only adds support for mcfunction. Contribution welcomed for config to enable support for `.mcdoc`, `.mcmeta`, `.snbt`, and pack `.json` files.

[[language]]
name = "mcfunction"
scope = "source.mcfunction"
file-types = ["mcfunction"]
roots = ["pack.mcmeta"]
comment-tokens = ["#"]
language-servers = ["spyglassmc"]

[language-server.spyglassmc]
command = "spyglassmc-language-server"
args = ["--stdio"]

Table of contents