Skip to content

Default js mods

Oxillen Glow edited this page Aug 2, 2026 · 5 revisions

in construction 🚧

Go here for actual code

Message convention anf use

Kill player

To kill a player send a JSON.stringify(JSONobject) that has fields

{
    messageType: "die",
    reason: "you staved" // or anything else here
}

Placement

When a block is placed and placement is registered and intercepted by Open_Inventory/SurvivalFramework mod pack, a message of content:

{
    messageType: "blockNotifyFromFramework",
    x: x, y: y, z: z,
    pre: pre, //the block before
    post: post //the block after
}

strinified will be sent out

Warning

Inventory has been moved to java side so best to use the Engine api to register listeners for block place.

Send messages with

Mod.send(JSON.stringify({
    messageType: "someType",
    //... rest of message
}));

Recive messages with

function onReceive(data, fromPack) {
    var msg;
    try {
        msg = JSON.parse(data);
    } catch (e) {
        return; // not JSON — not meant for us
    }
    // ... rest of your on recive stuff
}

Image MtSharpGrain


(don't worry ANYONE can make their own mod as modding is super easy especially with AI. You can make a mini game mod of whatever fun idea you had!)

jVisualScripting (still in construction 🚧)

To download:

Go to Downloads scroll down to bottom of the release card and click the assets to find the build for your platform. For more see install page

Clone this wiki locally