Skip to content

Setting up VSCode with HexDebug

[object Object] edited this page Sep 3, 2024 · 1 revision

Setup

  1. Install HexDebug and its dependencies like a normal Minecraft mod.
  2. Install VSCode if you don't already have it.
    • Note: That's Visual Studio Code, not to be confused with Visual Studio, which is a completely different IDE.
  3. Install the Hex Casting extension for VSCode.
    Example
  4. In VSCode, open a folder that you want to use for debugging hexes.
    Example
  5. Within the folder you opened, create a folder called .vscode, then create a file within that folder called launch.json. Paste the following text into that file:
    {
        "configurations": [
            {
                "type": "hexdebug",
                "request": "attach",
                "name": "HexDebug: Attach",
                "port": 4444,
                "stopOnEntry": true,
                "stopOnExit": false,
                "skipNonEvalFrames": true,
                "indentWidth": 4,
            },
        ],
    }
    Example

Usage

  1. In Minecraft, write a list of patterns to a focus, spellbook, or other iota-holding item.
    Example
  2. Put the iota-holding item in one hand, then right-click with a debugger in the other hand to start debugging the contents of the item.
    Example
  3. In VSCode, with the same folder opened as before, open the Run and Debug tab in the sidebar.
    Example
  4. Ensure HexDebug: Attach is selected in the dropdown menu in the top left, then click the green "Start Debugging" button to attach to the running debugger.
    Example

Note: You can also do these steps in the opposite order. VSCode can attach to HexDebug without an active debug session; you just need to be ingame (ie. it won't work on the title screen).

Troubleshooting

Port already in use

If something on your computer is already using port 4444, you can change the port used for debugging in HexDebug's mod settings, which can be configured ingame via the Mods menu, or via the config file in the game folder. Remember to also update the port in the launch.json file to match.

Example

Further reading

Clone this wiki locally