Getting Started

Basics of KubeJS


It is mandatory that you learn the basics of programming and JavaScript before you start using KubeJS!
Starting off, you will need a code editor. A code editor will make your code more readable, and help you find errors you have made.
We recommend Visual Studio Code, which has native support for JS.

#Using ProbeJS

ProbeJS is an essential addon for KubeJS that allows for code completion based on generated TypeScript files.
It can help you find methods and fields, and provide documentation for methods, functions, and event handlers.
To use ProbeJS, you first need to start up your game with both it and KubeJS installed, go into a world, and run the command /probejs dump.
This command will generate all the typings (documentation) within your modpack's folder.
The next thing you need to do is open your modpack's folder (be it named .minecraft, or your modpack's name) in Visual Studio Code and open the kubejs folder.

#The Folder Structure

The Folder Structure category explains the kubejs folder structure in more depth.
For now, there are 3 folders that you should be aware of:
  • server_scripts
  • client_scripts
  • startup_scripts
These are Script Folders in which you'll write your scripts.
Now, you should be ready to begin using KubeJS!
Look to the other wiki pages for more info, and if you have any more questions, feel free to ask in the latvian.dev Discord Server!