Inspired by the Sanity: Descent Into Madness mod, players will gain some bad effects when in low sanity. Textures modified from Sanity: Descent Into Madness by croissantnova (consent). Sound effects provided by Zapsplat. Since version 1.3.3, you need Baubles mod as dependency.
This mod adds a garland, an umbrella, and a potion of composure to the game. The following are their feature descriptions.
Each garland has 60 durability in total, use any small flowers to craft it. Water, fire, lightning, and explosion can lead to damage it while wearing on head. (Equipped in armor or baubles slot)
Holding an umbrella can prevent player from decreasing sanity and damaging garland by rain. Umbrella has 120 durability, which will damage from lightning, fire, explosion. And break or attack can also damage it. 
Add composure potion effect, which can recover 1 sanity every 60 >> amplifier ticks. Brew any small flowers with an regeneration potion.
Most feature support custom configurations. Turn to mod's config file for more information.

Using potion of composure or morphine in First Aid mod grants temporary immunity to all negative effects.
Using commands need permission level 2. (support tab completion) 
All compatibility features will be enabled automatically when the mod is installed.
Add a ZenExpansion for IPlayer (sanity), which can return player's sanity value as float. And you can also use it to modify a player's sanity value like this:player.sanity += 2.5. Developers can call this method on any IPlayer object, including its subtypes.
import crafttweaker.event.BlockHarvestDropsEvent;
events.onBlockHarvestDrops(function(event as BlockHarvestDropsEvent) {
if(!event.world.isRemote()) {
var id = event.block.definition.id;
if (id == "minecraft:red_flower" && event.player.sanity <= 10) {
event.drops = [<minecraft:deadbush> % 100];
}
}
});
This example script makes any small flowers drop a dead bush when broken by a player with sanity of 10 or less.
The player's average nutrition level affects the rate at which sanity increases or decreases. (support Nutrition Unofficial Extended Life and its forks version)
Warp in Thaumcraft 6 can affect player's max sanity. max = 100 - warp (permanent value and normal value, no more than 50)
Only the codebase has been open source under the Apache License 2.0, you can use, modify the code to port, distribute this mod under the license. Sound effects retain their respective license. All rights reserved for all other assets. And there are currently no plans to make a mod like this for a new Minecraft version.