croissantnova/SanityDescentIntoMadness

Invisible Sanity Suckers

Opened this issue · 4 comments

Hey, so earlier today, I encountered a part of my world where my sanity drained for absolutely no reason. I checked to see if there were mobs around, nope. Anything else I could be near that I could see? Nope.
So I turned hitboxes on.
2023-12-06_16 45 52
What the balls is that? I guess it's an invisible version of the fiends that show up around the world.
The problem I have with this is the fact that I can't see or handle what's draining my sanity, so I believe this to be a bug of some sort.
My sanity was almost full before I found this little goober.

This is an "intentional flaw", as back then I thought there was no other way to make it work in multiplayer, but now it comes to mind that a simple fix would be to despawn entities when there are no insane players around, or at least make it so they don't drain the sanity of those who don't see them. I'll get back to it in the next update.

i was about to create this same issue i hope it gets fixed soon

a simple fix would be to despawn entities when there are no insane players around

This would be greatly appreciated. I love the mechanics of this mod, but these invisible guys make for a very strange experience for players.

Just gonna leave this here for now until a proper fix can be implemented in the mod.

Disclaimer, provided as is and without warranty. I didn't write the core of it, just tweaked an existing script to work for this. Please don't @ me for help :P

KubeJS\startup_scripts

ForgeEvents.onEvent('net.minecraftforge.event.entity.living.LivingChangeTargetEvent', (event) => {
    global.changetarget(event);
});

/**
 *
 * @param {Internal.LivingChangeTargetEvent} event
 */
global.changetarget = (event) => {
    let { entity, newTarget } = event;
    if ((entity.type == 'sanitydim:rotting_stalker' || entity.type == 'sanitydim:sneaking_terror') && !newTarget) {
        entity.kill();
    }
};