MarieLib provides a threshold effect system that consuming mods wire to their gameplay. Effects fire automatically when value levels cross configured thresholds.
โ๏ธ Threshold Types
Effects are defined via ThresholdEffect and registered through MarieAPI.registerCustomEffect() or datapacks (loader in progress).
| Type | When it fires |
|---|---|
CRITICAL |
Value drops below critical threshold |
LOW |
Value drops below low threshold |
EXCESS |
Value exceeds excess threshold |
BONUS |
Value is within bonus range (e.g. all values above threshold) |
๐ Datapack Format (schema defined)
Path: data/<ns>/<modId>/effects/<id>.json
{
"marie_schema_version": 1,
"value_key": "proteins",
"threshold": 0.2,
"threshold_type": "LOW",
"effect_id": "minecraft:weakness",
"amplifier": 0,
"duration": 300
}
| Field | Required | Description |
|---|---|---|
value_key |
โ | Which value triggers this effect |
threshold |
โ | Trigger point (0.0โ1.0) |
threshold_type |
โ | CRITICAL, LOW, EXCESS, or BONUS |
effect_id |
โ | Vanilla or modded effect ID |
amplifier |
Effect level (0 = level I) | |
duration |
Duration in ticks (20 ticks = 1 second) |
The datapack loader for
effects/is still in progress. Consuming mods may load effects from their own config files until the MarieLib loader is complete.
โ Java API
ThresholdEffect effect = ThresholdEffect.builder()
.valueKey("proteins")
.threshold(0.25f)
.thresholdType(ThresholdEffect.ThresholdType.LOW)
.effectId(ResourceLocation.parse("minecraft:mining_fatigue"))
.amplifier(0)
.duration(140)
.build();
MarieAPI.registerCustomEffect(effect);
Consuming mods provide their own effect applier wired through MarieLibContext. MarieLib fires threshold crossings; the consuming mod applies potion effects.
๐ Related Pages
MarieLib ยท Shared framework for Marie mods ยท Documentation for 1.0.x
Modrinth ยท GitHub ยท Nourished Wiki ยท Report an Issue