"sanity" mechanic

Started by superdiamondsky665 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
"sanity" mechanic

hello

i would like to make something like a "sanity bar" displayed above hearts that decreases when you enter dark zones or hit by certain mobs. and when your sanity is too low you start hearing weird noises and see things that doesn't exist

i think it's possible using overlays, but i don't know how.

can someone help please ?

thank you

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't think the bar is…
Fri, 03/25/2022 - 19:08

I don't think the bar is possible, maybe you can make it an invisible stat like saturation

Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
the bar is possible but its…
Thu, 04/07/2022 - 22:32

the bar is possible but its very hard to make the easiest way is to do it with variable and then make an overlay that display that variable using text then make a procedure that checks the value of the sanity of the player then make it plays your noises and for things that doesnt exist you can make mobs that spawn near the player then after like 2 seconds they despawn

Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
bump
Thu, 04/14/2022 - 23:40

bump

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's definitely possible for…
Fri, 04/15/2022 - 04:08

It's definitely possible for you to make the bar, along with the whole illusions thing, but it is a bit complex. You would need to make multiple different variants of the bar, each with a different amount filled, along with the procedures to detect when you enter a dark zone, then choose how many ticks it would need for the bar to decrease by one.

The illusions are something i don't exactly know how to do, although I can say its possible. Mrlofe2003x brought a good idea for the illusions, but I think that there could be more to it. Maybe with some manipulations, you could end up making a mob that pathfinds its way to you, but doesn't attack you, and you couldn't attack it. I think that could be a way of doing things.