
Extend your game with JavaScript, create and publish commands, menus, toggles and much more!
JSCore is a thin wrapper around FabricMC.
This mod provides full JavaScript support for Minecraft modding, you can create or use community modules to customise your game.
In short, JSCore can do
*Mixins support depends on whether one guy on Discord can get it to work or not.
Just download the mod and run the game!
Read the Quickstart Guide.
JSCore allows access to classes in the net.minecraft package - anything that FabricMC can do (except Mixins), JSCore can also do it.
// client: net.minecraft.client.MinecraftClient
let client = net.minecraft.client.MinecraftClient.getInstance();
// player: net.minecraft.client.network.ClientPlayerEntity
let player = client.player;
// position: net.minecraft.util.math.BlockPos
let position = player.getBlockPos();
The module system from Node.js allows complex game mechanics to be built from small and managable chunks, so we brought it to JSCore.
// init.js
let savePlayers = require("./savePlayers");
savePlayers();
// savePlayers.js
let fs = require("fs");
let { getPlayers } = require("./getPlayers");
function savePlayers() {
let players = getPlayers();
let content = JSON.stringify(players);
fs.writeFileSync("./playerList.json", content);
}
module.exports = savePlayers;
This mod runs init.js on start.
Additional features are provided by third-party modules, such as
console.log and fs.A list of package can be found in the package repository, anyone can publish packages to this repository.
The Minecraft code is obfuscated and cannot be referred to by their real name. This mod uses Yarnwrap, which wraps all net.minecraft classes so their real name can be used instead of their obfuscated name.
This mod is still in its early stages, please join Discord for support or to sway its development.