Back to mods
KubeJS Sanity project artwork

CurseForge · Minecraft mod

KubeJS Sanity

Sanity integration for KubeJS

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which KubeJS Sanity release should I use?

Updated 5 months ago
Latest stable file SanityJS-1.2.0-1.19.2.jar
Game version 1.19.2
Loader Forge

KubeJS Sanity SanityJS-1.2.0-1.19.2.jar targets 1.19.2 with Forge. The project page does not say whether this file belongs on the client, dedicated server, or both. All 5 required mods have matching files.

Where it goes

Is KubeJS Sanity required on the client, server, or both?

The project page does not say whether this file belongs on the client, dedicated server, or both.

Client Source doesn’t say
Dedicated server Source doesn’t say
Loader for this release Forge
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

The source does not explicitly classify this release as client-only or server-only.

What else does KubeJS Sanity SanityJS-1.2.0-1.19.2.jar need?

SanityJS-1.2.0-1.19.2.jar. Change the file and its required mods may change too.

All 5 required mods have matching files

Install Sanity: Descent Into Madness, KubeJS, GeckoLib, Rhino and 1 more first. We found matching files for this game-version and loader setup. 3 come through another mod in the chain.

2 listed on this file 3 pulled in by those mods
Sanity: Descent Into Madness Needed by KubeJS Sanity SanityJS-1.2.0-1.19.2.jar
required
Matching file found Matched file: sanitydim-mc1.19.2-1.1.0
KubeJS Needed by KubeJS Sanity SanityJS-1.2.0-1.19.2.jar
required
Matching file found Matched file: KubeJS Forge 1902.6.2-build.73
GeckoLib Needed by Sanity: Descent Into Madness
pulled in
Matching file found Matched file: geckolib-forge-1.19-3.1.40.jar
Rhino Needed by KubeJS
pulled in
Matching file found Matched file: Rhino Forge 1902.2.3-build.284
Architectury API Needed by KubeJS
pulled in
Matching file found Matched file: [Forge 1.19.2] v6.6.92

3 extra mods were pulled in by other dependencies. Indented rows show who needs each one. We only count dependency files that match this setup. A file for another loader does not fill the gap.

Before you install it

Add KubeJS Sanity without breaking your instance.

Built for KubeJS Sanity SanityJS-1.2.0-1.19.2.jar. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use SanityJS-1.2.0-1.19.2.jar. It targets 1.19.2 with Forge; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    Install Sanity: Descent Into Madness, KubeJS, GeckoLib, Rhino and 1 more first. We found matching files for this game-version and loader setup. 3 come through another mod in the chain.

  3. 03

    Put it on the correct side

    The project page does not say whether this file belongs on the client, dedicated server, or both.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside SanityJS-1.2.0-1.19.2.jar. It opens that exact file at the source.

About this project

What does KubeJS Sanity add?

🧰 Intro

Sanity integration for Kubejs. Add/Modify Sanity's feature so the kubejs users can has more control on Sanity.

🔧 Completed Features

1. Event in KJS

SanityEvents.change(event => {
    // Access old and new sanity values
    let oldSanity = event.getPreviousSanity();
    let newSanity = event.getSanity();

    // Example: Apply effects or trigger custom logic
    if (newSanity <= 20) {
        event.getEntity().addPotionEffect('minecraft:nausea', 200, 1);
    }
});
SanityEvents.indicatorRender(event => {
    event.cancel();
})

2. Sanity Manipulation Methods

The integration provides several methods to manage sanity values effectively:

getSanity(): Returns the current sanity value.

getPreviousSanity(): Returns the sanity value before the change.

setSanity(value): Sets the player's sanity to a specific value (0-100).

addSanity(value): Increases the player's sanity by the specified amount.

player.getSanity(): get Player's sanity directly.

3. Utility Functions

Additional utility functions are provided to handle mathematical operations related to sanity:

clampNorm(value): Normalizes a number to a value between 0 and 1.

unclampNorm(normalizedValue): Converts a normalized value back to a readable number.

approximation(value, n): Truncates a number to n significant decimal places, useful for precise sanity calculations.

🔍 Areas for Improvement

Adding more events to allow complete modification and controll of Sanity's tickPlayer.

Adding more events about render to allow better controll on render effects.

Additional Sanity Sources: Consider expanding sanity manipulation to include more sources or conditions, such as environmental effects or interactions with specific mobs.

🔄 Future Enhancements

Add Passive source of Sanity (Might support Hot reload?).

Able to modify visible rules based on player's sanity.

By incorporating these features and potential enhancements, the Sanity integration for KubeJS aims to offer a richer and more interactive modding experience for both developers and players.

> Please Join our Discord server if you have any quesion.

Project description from CurseForge.

Pick your setup

KubeJS Sanity by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

4 available setups

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

KubeJS Sanity versions and loaders

9 of 9 releases match

Looking for an older file? The official CurseForge project page is in Resources.