ProbeJS
ProbeJS is a typing generation tool specifically designed for KubeJS integration. It significantly simplifies script writing by providing intelligent code hints and autocompletion in the development environment.
With the VSCode extension installed, you get detailed information about items and fluids when hovering over corresponding elements in the code.
In version 1.20.1, the display of item and fluid icons was removed. To view icons when hovering the cursor, it's recommended to install and use the IconExporter mod. The absence of this mod doesn't affect the core functionality of the extension.
How to Use
Install the mod, run the "/probejs dump" command in singleplayer, then open the .minecraft folder in VSCode as a workspace.
The .minecraft folder is the parent directory of the KubeJS folder.
After completing these steps, autocompletion and type documentation will appear when working with JavaScript files in the KubeJS folder.
Try entering constructs like @item or @block to see automatically generated code snippets.
Troubleshooting
If hints don't appear in VSCode, check the following:
- The .vscode folder inside the .minecraft directory contains numerous JSON files with the "probe" prefix
- The KubeJS folder contains a "probe" subdirectory with files having the ".d.ts" extension
- None of the ".d.ts" files contain syntax errors indicated by VSCode
If all three conditions are met, you might need to configure VSCode to work correctly with the typing generated by ProbeJS, or the editor cannot properly handle the JavaScript project created by the mod.
If errors occur, especially during the third verification step, it's recommended to create an issue on GitHub to resolve the problem.