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

ConceptDescription
Cascade ChainEvent A → triggers B → triggers C. Each link has a delay and chance.
PreventionPlayers complete quests to block cascades before they fire.
Emergency QuestsAuto-assigned quests to ALL online players with a deadline.
ConsequencesPermanent world changes: destroyed POIs, dead NPCs, new zones.
TimelineFull history of all events on the server.
ConditionsEvents only fire when conditions are met (season, time, world state).
SeverityLevels: minor → moderate → major → catastrophic.

Configuration

{
  "WorldEvents": {
    "Enabled": false,
    "MinCooldownBetweenEventsMinutes": 60,
    "EventChancePerCheck": 0.02,
    "CascadesEnabled": true,
    "ConsequencesEnabled": true,
    "MaxCascadeDepth": 5,
    "MaxTimelineRecords": 200,
    "PreventionThreshold": 3
  }
}
ParameterDefaultDescription
EnabledfalseEnable/disable the module
MinCooldownBetweenEventsMinutes60Minimum gap between random events
EventChancePerCheck0.02Chance per 30s tick (2%)
CascadesEnabledtrueEnable cascade chains
ConsequencesEnabledtrueEnable permanent consequences
MaxCascadeDepth5Max cascade chain depth
MaxTimelineRecords200Max timeline entries kept
PreventionThreshold3Players needed to prevent a cascade

Built-in Events

EventSeverityDurationCooldownEffect
Ash Stormminor15 min2hSpawns distorted locusts
Blood Moonminor20 min3h+50% mob damage, +100% aggro
Void Riftminor10 min1.5hSpawns corrupt shivers, intoxication
Meteor Showerminor8 min2.5hRandom 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

FieldTypeDescription
eventIdstringUnique identifier
nameKey / descKeystringLocalization keys
durationMinutesfloatEvent duration
cooldownMinutesfloatCooldown before re-trigger
weightfloatRandom selection weight (0 = never random)
severitystringminor, moderate, major, catastrophic
tagsstring[]Tags for categorization and conditions
cascadeOnlyboolIf true — only fires via cascade, never randomly
effectsstring[]Active effects during the event
conditionsarrayConditions required for the event to fire
preventableByQuestsstring[]Quests that can prevent this event
cascadesarrayLinks to next events in the chain
consequencesarrayPermanent world changes when unprevented

Cascade System

Cascades are chains where one event's completion can trigger the next.

{
  "targetEventId": "monster_migration",
  "delayHours": 6.0,
  "chance": 0.8,
  "requiresUnprevented": true,
  "minPlayersOnline": 2,
  "emergencyQuest": {
    "questId": "quest_fortify_village",
    "deadlineHours": 5.0,
    "requiredCompletions": 2
  }
}
FieldDescription
targetEventIdNext event in the chain
delayHoursGame-hours delay before firing
chanceProbability (0-1). 1.0 = guaranteed
requiresUnpreventedOnly fires if parent was NOT prevented
minPlayersOnlineMinimum players online required
emergencyQuestAuto-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
}
FieldDescription
questIdQuest to assign (must exist in registry)
deadlineHoursTime limit (-1 = same as cascade delay)
requiredCompletionsPlayers needed (-1 = global threshold)
failureEventIdEvent on failure (additional to cascade)
successEventIdEvent on success (reward/celebration)
exclusiveIf 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

TypeDescription
destroy_poiDestroys a point of interest (replaces with ruins)
kill_npcPermanently kills an NPC
corrupt_zoneCorrupts a zone (affects spawns, weather)
unlock_areaOpens a previously inaccessible area
spawn_structureGenerates a new structure
set_flagSets a world state flag
disable_merchantDisables a merchant
spawn_permanent_mobsPermanent 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.

TypeDescriptionExample
world_stateCheck a world flag"drought_active" eq "true"
time_of_dayTime (0-24)"hour" gte "20"
seasonCurrent season"season" eq "winter"
player_countOnline players"count" gte "3"
event_historyPast events"drought" gt "0"
consequence_activeActive consequence"eastern_plains" eq "true"
tag_activeActive tag"corruption" eq "true"

Operators: eq, neq, gt, lt, gte, lte, contains, not_contains

Commands

CommandPrivilegeDescription
/worldevent timelinechatView last 10 events
/worldevent statuschatCurrent status
/worldevent consequenceschatActive consequences
/worldevent threatschatPending cascade threats
/worldevent force <id>adminForce-start an event
/worldevent stopadminStop active event
/worldevent resetadminReset all state
/worldevent flagsadminList 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

Press ESC to close