https://github.com/inspiaaa/jsmod
Brings the JS Superpowers to Minecraft modding
https://github.com/inspiaaa/jsmod
Last synced: about 1 month ago
JSON representation
Brings the JS Superpowers to Minecraft modding
- Host: GitHub
- URL: https://github.com/inspiaaa/jsmod
- Owner: Inspiaaa
- Created: 2020-12-20T16:54:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-26T09:06:56.000Z (about 5 years ago)
- Last Synced: 2025-01-12T12:20:10.524Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 169 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JSMod
JSMod further democratises the **Minecraft modding** world by bringing the superpowers of **JavaScript** to Minecraft. With JSMod lightweight mods can be written and created in **modern ES6 JS** and updated during play (hot reload).
The JS code is then executed using the state of the art JavaScript runtime **V8**. It's also worth noting that **JSMod** itself is a **Forge mod**, which means that it can be used alongside other mods.
### Architecture
JSMod only provides the link between Minecraft's Java codebase and your JavaScript code, but also includes optional JavaScript files which make coding modules and interacting with the Java side a lot easier.

JSMod calls the event methods (such as onTick) and creates the basic namespaces required for communicating between Java and JS. The optional JS files aren't strictly necessary, but add more namespaces (e.g. `Engine` for modules) and constants (e.g. `KEY_A` for key codes, `Chat.RED` for chat colours and effects)
### Getting started
1. Make sure you have the correct Minecraft version and the corresponding forge version installed
2. **Download** the mod jar file (e.g `jsmod-1.11.2-0.0.1.jar`) and the js files (e.g. `js-0.0.1.zip`) from the [Releases](https://github.com/LavaAfterburner/JSMod/releases) page
3. Install the mod by **moving** the downloaded **jar** file to the forge **mods folder** (On Windows`C:\Users\...\AppData\Roaming\.minecraft\mods`)
4. Set up your coding environment
1. **Find** (or create) **a folder** that you want to use to start coding your JS mods (e.g. `C:\Users\...\Documents\js`)
2. **Unzip** the JavaScript files zip and copy the contained files into the folder
3. Now you can start coding in the `src` subdirectory
5. **Launch** Minecraft
6. In the main menu, click on `Mods`, scroll down until you find `JSMod`, click on it and select `Config`. Change the `Root file path` field to the file path of your coding environment for the JS mods (e.g. `C:\Users...\Documents\js`)
**And you're ready to go!**
Updating the code at runtime: JSMod supports a hot reload system which let's you make changes to your code and reload without having to restart Minecraft. This system even preserves the state of your modules between reloads.
To trigger a reload call the `/hotreload` command in Minecraft.