Mod

KubeJS Sanity

Quick rating

KubeJS Sanity

No reviews yet

Sanity integration for KubeJS

Mod Loaders
Forge
NeoForge
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

About

Project Details

Type
Mod
Latest Version
SanityJS-1.2.0-1.19.2.jar
Authors

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID

Resources

External Links

Source Issues Wiki Discord

About

Description

🧰 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.

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

~200,000
Downloads
Last Updated
Created
Last synced
When ModDex last fetched and imported data for this project from CurseForge or Modrinth. High-traffic and active projects are checked more often.
Next pipeline sync