Skip to content
mcbookshelfPublic

About

Debug adapter for Minecraft datapacks, enabling breakpoints, step execution, and game-state inspection directly in VSCode.

Resources

Code of conduct

Contributing

Stars

18 stars

Watchers

1 watching

Forks

Repository files navigation

Sniffer

Tests     Discord

Sniffer turns a running Minecraft game into a debugger for your .mcfunction datapacks, driven from Visual Studio Code.

A paused function in VS Code

A function paused on a breakpoint, with its call stack and the game state at that point.

Sniffer comes in two parts:

🧩 Mod Runs inside Minecraft and exposes the game as a Debug Adapter Protocol server. Also adds the in game debug commands (/breakpoint, /trace, #!log, #!assert, ...) and hot reload of edited functions.
🔌 Extension Connects VS Code to a running game, so breakpoints, stepping, variable inspection and the call graph of a traced execution work in .mcfunction files the way they do in any other language.

Quickstart

Install Fabric Loader, then drop the Sniffer jar into your mods folder alongside Fabric API and Cloth Config, and install the Sniffer extension in VS Code.

Open your datapack in VS Code and accept the notification offering to add a debug configuration:

{
  "type": "sniffer",
  "request": "attach",
  "name": "Connect to Minecraft",
  "address": "ws://localhost:25599/dap"
}

Load your world, run Connect to Minecraft from the Run and Debug view, and accept the authorization dialog that pops up in game. Set a breakpoint in a .mcfunction file, call that function with /function, and the execution halts before the marked command.

Documentation

  • Quickstart — install and first breakpoint
  • VS Code — launch configuration, debug toolbar, variables, breakpoint kinds, trace graph
  • Commands — /breakpoint, /trace, #!log, #!assert, #!watch, ...
  • Expressions — the { ... } mini language reading scores, NBT and entity names
  • Contributing — building the mod and running the tests

The pages are built with Sphinx and published on Read the Docs. uv installs the tooling on first run:

uv run docs build   # HTML into docs/_build
uv run docs watch   # live reload on http://127.0.0.1:8000

Acknowledgements

Sniffer is built on Datapack Debugger by Alumopper, and adds the Debug Adapter Protocol layer on top of it.

About

Debug adapter for Minecraft datapacks, enabling breakpoints, step execution, and game-state inspection directly in VSCode.

Resources

Code of conduct

Contributing

Stars

18 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages