World Events
> ⚠️ EXPERIMENTAL — Disabled by default. API may change.
World Events — server-wide events that affect gameplay. The system has been expanded into a Living World Pipeline — a cascading event system where events trigger other events, players can prevent catastrophes, and the world changes permanently.
Key Concepts
| Concept | Description |
|---|---|
| Cascade Chain | Event A → triggers B → triggers C. Each link has a delay and chance. |
| Prevention | Players complete quests to block cascades before they fire. |
| Emergency Quests | Auto-assigned quests to ALL online players with a deadline. |
| Consequences | Permanent world changes: destroyed POIs, dead NPCs, new zones. |
| Timeline | Full history of all events on the server. |
| Conditions | Events only fire when conditions are met (season, time, world state). |
| Severity | Levels: minor → moderate → major → catastrophic. |
Configuration
{
"WorldEvents": {
"Enabled": false,
"MinCooldownBetweenEventsMinutes": 60,
"EventChancePerCheck": 0.02,
"CascadesEnabled": true,
"ConsequencesEnabled": true,
"MaxCascadeDepth": 5,
"MaxTimelineRecords": 200,
"PreventionThreshold": 3
}
}| Parameter | Default | Description |
|---|---|---|
Enabled | false | Enable/disable the module |
MinCooldownBetweenEventsMinutes | 60 | Minimum gap between random events |
EventChancePerCheck | 0.02 | Chance per 30s tick (2%) |
CascadesEnabled | true | Enable cascade chains |
ConsequencesEnabled | true | Enable permanent consequences |
MaxCascadeDepth | 5 | Max cascade chain depth |
MaxTimelineRecords | 200 | Max timeline entries kept |
PreventionThreshold | 3 | Players needed to prevent a cascade |
Built-in Events
| Event | Severity | Duration | Cooldown | Effect |
|---|---|---|---|---|
| Ash Storm | minor | 15 min | 2h | Spawns distorted locusts |
| Blood Moon | minor | 20 min | 3h | +50% mob damage, +100% aggro |
| Void Rift | minor | 10 min | 1.5h | Spawns corrupt shivers, intoxication |
| Meteor Shower | minor | 8 min | 2.5h | Random lightning strikes |
Custom Events
Place JSON files in assets/yourmod/config/worldevents/:
{
"eventId": "drought",
"nameKey": "worldevent-drought",
"descKey": "worldevent-drought-desc",
"durationMinutes": 30,
"cooldownMinutes": 360,
"weight": 0.6,
"severity": "minor",
"tags": ["weather", "natural"],
"cascadeOnly": false,
"effects": ["weather:clear", "temperature:+10"],
"conditions": [
{ "type": "season", "key": "season", "op": "eq", "value": "summer" }
],
"preventableByQuests": ["quest_rain_ritual"],
"cascades": [
{
"targetEventId": "monster_migration",
"delayHours": 6.0,
"chance": 0.8,
"requiresUnprevented": true,
"minPlayersOnline": 0,
"emergencyQuest": {
"questId": "quest_build_barriers",
"deadlineHours": 5.0,
"requiredCompletions": 2,
"failureEventId": null,
"successEventId": "celebration_feast"
}
}
],
"consequences": [
{
"type": "set_flag",
"target": "world_drought_active",
"parameters": { "value": "true" },
"descriptionKey": "consequence-drought-crops",
"reversible": true
}
]
}Event Definition Fields
| Field | Type | Description |
|---|---|---|
eventId | string | Unique identifier |
nameKey / descKey | string | Localization keys |
durationMinutes | float | Event duration |
cooldownMinutes | float | Cooldown before re-trigger |
weight | float | Random selection weight (0 = never random) |
severity | string | minor, moderate, major, catastrophic |
tags | string[] | Tags for categorization and conditions |
cascadeOnly | bool | If true — only fires via cascade, never randomly |
effects | string[] | Active effects during the event |
conditions | array | Conditions required for the event to fire |
preventableByQuests | string[] | Quests that can prevent this event |
cascades | array | Links to next events in the chain |
consequences | array | Permanent world changes when unprevented |
Cascade System
Cascades are chains where one event's completion can trigger the next.
Cascade Link
{
"targetEventId": "monster_migration",
"delayHours": 6.0,
"chance": 0.8,
"requiresUnprevented": true,
"minPlayersOnline": 2,
"emergencyQuest": {
"questId": "quest_fortify_village",
"deadlineHours": 5.0,
"requiredCompletions": 2
}
}| Field | Description |
|---|---|
targetEventId | Next event in the chain |
delayHours | Game-hours delay before firing |
chance | Probability (0-1). 1.0 = guaranteed |
requiresUnprevented | Only fires if parent was NOT prevented |
minPlayersOnline | Minimum players online required |
emergencyQuest | Auto-quest config (see below) |
Example Cascade Chain
Drought (minor, 30 min)
↓ [6h delay, 80% chance]
Monster Migration (moderate, 25 min) ← preventable!
↓ [4h delay, 60% chance, 2+ players]
Village Siege (major, 20 min) ← preventable!
↓ [2h delay, 40% chance, 3+ players]
Village Destruction (catastrophic, 10 min) ← last chance!Each link gives players time to react. The further down the chain, the more severe the consequences.
Emergency Quests
When a cascade is queued, the system can automatically assign a quest to ALL online players with a deadline.
How It Works
- Event A ends → cascade to B is queued
- Emergency quest is auto-assigned to all online players
- New players joining also receive the quest automatically
- Progress is announced to everyone: *"Progress: 1/2 — 1 more needed!"*
- Enough completions → cascade prevented + optional success event
- Deadline expires → cascade proceeds + optional failure event
Emergency Quest Config
{
"questId": "quest_fortify_village",
"deadlineHours": 3.5,
"requiredCompletions": 2,
"failureEventId": "punishment_raid",
"successEventId": "celebration_feast",
"exclusive": false
}| Field | Description |
|---|---|
questId | Quest to assign (must exist in registry) |
deadlineHours | Time limit (-1 = same as cascade delay) |
requiredCompletions | Players needed (-1 = global threshold) |
failureEventId | Event on failure (additional to cascade) |
successEventId | Event on success (reward/celebration) |
exclusive | If true, only this quest can prevent the cascade |
Prevention System
Two ways to prevent cascades:
- Manual — Players find and complete quests from
preventableByQuests - Emergency Quests — System auto-assigns quests with deadline
When PreventionThreshold players complete a preventive quest, the cascade is blocked.
Consequences
Permanent world changes applied when an event ends unprevented.
Consequence Types
| Type | Description |
|---|---|
destroy_poi | Destroys a point of interest (replaces with ruins) |
kill_npc | Permanently kills an NPC |
corrupt_zone | Corrupts a zone (affects spawns, weather) |
unlock_area | Opens a previously inaccessible area |
spawn_structure | Generates a new structure |
set_flag | Sets a world state flag |
disable_merchant | Disables a merchant |
spawn_permanent_mobs | Permanent mob spawns in a zone |
Reversible vs Permanent
{ "type": "kill_npc", "target": "village_elder", "reversible": false }{ "type": "corrupt_zone", "target": "eastern_plains", "reversible": true }Reversible consequences can be undone via restoration quests.
Conditions
Events only fire when all conditions are met.
| Type | Description | Example |
|---|---|---|
world_state | Check a world flag | "drought_active" eq "true" |
time_of_day | Time (0-24) | "hour" gte "20" |
season | Current season | "season" eq "winter" |
player_count | Online players | "count" gte "3" |
event_history | Past events | "drought" gt "0" |
consequence_active | Active consequence | "eastern_plains" eq "true" |
tag_active | Active tag | "corruption" eq "true" |
Operators: eq, neq, gt, lt, gte, lte, contains, not_contains
Commands
| Command | Privilege | Description |
|---|---|---|
/worldevent timeline | chat | View last 10 events |
/worldevent status | chat | Current status |
/worldevent consequences | chat | Active consequences |
/worldevent threats | chat | Pending cascade threats |
/worldevent force <id> | admin | Force-start an event |
/worldevent stop | admin | Stop active event |
/worldevent reset | admin | Reset all state |
/worldevent flags | admin | List world flags |
Timeline
Full history of all server events. Records:
- Event ID, start/end time
- Whether it was prevented (and by which quest)
- Consequences applied
- Cascade source (if part of a chain)
Architecture
- Check every 30s (only when enabled + players online)
- Cascades have priority over random events
- Max cascade depth prevents infinite loops
- State (timeline, cascades, consequences) persists across restarts
- World flags accessible by other systems (quests, NPCs, merchants)
- Zero load when disabled or no active event