# asthewindx/survivor architecture

> Architecture diagram of the GitHub repository asthewindx/survivor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/asthewindx/survivor
- Repository: https://github.com/asthewindx/survivor

## Overview

Survivor is a Minecraft zombie-apocalypse gameplay mod that reshapes survival rules and adds combat, environmental systems, item and block interactions, and UI. The player’s broad gameplay loop is represented by independently event-driven systems rather than one sampled request pipeline: player state and survival are supported by shared helpers, while combat, weather, blocks, items, lighting, and HUD provide distinct gameplay stages. The README also advertises behavior trees and modeling, but the supplied tree has no corresponding source paths, so those capabilities cannot be mapped more specifically. Edges reflect imports or calls visible in the supplied excerpts and SOURCE INDEX.

Main entry points: [`scripts/Script_Manifest.js`](https://github.com/asthewindx/survivor/blob/main/scripts/Script_Manifest.js) (Runtime registration), [`scripts/Shares/Config_Common.js`](https://github.com/asthewindx/survivor/blob/main/scripts/Shares/Config_Common.js) (Shared state and actions), [`scripts/Core/Player_Basic.js`](https://github.com/asthewindx/survivor/blob/main/scripts/Core/Player_Basic.js) (Player survival), [`scripts/Core/Temp.js`](https://github.com/asthewindx/survivor/blob/main/scripts/Core/Temp.js) (Seasons and weather)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime foundation"]
  node_shared["Shared state and actions<br/>[Config_Common.js]"]
  node_manifest["Runtime registration<br/>[Script_Manifest.js]"]
end

subgraph group_survival["Survival and combat"]
  node_player["Player survival<br/>[Player_Basic.js]"]
  node_environment["Seasons and weather<br/>[Temp.js]"]
  node_infected["Infected combat<br/>[Entity.js]"]
  node_firearms["Firearms<br/>[Attack.js]"]
end

subgraph group_gameplay["Gameplay systems"]
  node_blocks["Block interactions<br/>[Blocks.js]"]
  node_items["Item use and codex<br/>[Item.js]"]
  node_lighting["Handheld lighting<br/>[Light.js]"]
end

subgraph group_interface["Player interface"]
  node_hud["Status HUD<br/>[Hud.js]"]
  node_debug["Debug commands<br/>[Debug.js]"]
end

node_player_actor(("Player"))

node_manifest -->|"imports"| node_player
node_manifest -->|"imports"| node_shared
node_manifest -->|"imports"| node_environment
node_manifest -->|"imports"| node_debug
node_manifest -->|"imports"| node_hud
node_manifest -->|"imports"| node_items
node_manifest -->|"imports"| node_blocks
node_manifest -->|"imports"| node_firearms
node_manifest -->|"imports"| node_infected
node_manifest -->|"imports"| node_lighting
node_firearms -->|"uses hit logic"| node_infected
node_firearms -->|"uses helpers"| node_shared
node_infected -->|"calls death handling"| node_player
node_infected -->|"uses helpers"| node_shared
node_player -->|"uses helpers"| node_shared
node_environment -->|"calls fatigue handling"| node_player
node_environment -->|"uses helpers"| node_shared
node_blocks -->|"calls death handling"| node_player
node_blocks -->|"reads season"| node_environment
node_blocks -->|"uses helpers"| node_shared
node_items -->|"uses helpers"| node_shared
node_hud -->|"reads gun IDs"| node_items
node_hud -->|"uses helpers"| node_shared
node_lighting -->|"reads gun IDs"| node_items
node_lighting -->|"reads weather"| node_environment
node_lighting -->|"uses helpers"| node_shared
node_debug -->|"calls death handling"| node_player
node_debug -->|"sets weather"| node_environment
node_debug -->|"uses helpers"| node_shared
node_player_actor -.->|"plays through"| node_player
node_player_actor -.->|"uses"| node_firearms
node_player_actor -.->|"interacts"| node_blocks
node_player_actor -.->|"uses"| node_items

click node_player "https://github.com/asthewindx/survivor/blob/main/scripts/Core/Player_Basic.js"
click node_environment "https://github.com/asthewindx/survivor/blob/main/scripts/Core/Temp.js"
click node_infected "https://github.com/asthewindx/survivor/blob/main/scripts/Core/Entity.js"
click node_firearms "https://github.com/asthewindx/survivor/blob/main/scripts/Core/Attack.js"
click node_blocks "https://github.com/asthewindx/survivor/blob/main/scripts/Systems/Blocks.js"
click node_items "https://github.com/asthewindx/survivor/blob/main/scripts/Systems/Item.js"
click node_lighting "https://github.com/asthewindx/survivor/blob/main/scripts/Systems/Light.js"
click node_hud "https://github.com/asthewindx/survivor/blob/main/scripts/Systems/Hud.js"
click node_debug "https://github.com/asthewindx/survivor/blob/main/scripts/Shares/Debug.js"
click node_shared "https://github.com/asthewindx/survivor/blob/main/scripts/Shares/Config_Common.js"
click node_manifest "https://github.com/asthewindx/survivor/blob/main/scripts/Script_Manifest.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_shared,node_manifest toneBlue
class node_player,node_environment,node_infected,node_firearms toneAmber
class node_blocks,node_items,node_lighting toneMint
class node_hud,node_debug toneRose
class node_player_actor toneIndigo
```

## Components

### Runtime foundation

- [Shared state and actions](https://github.com/asthewindx/survivor/blob/main/scripts/Shares/Config_Common.js): `scripts/Shares/Config_Common.js`
- [Runtime registration](https://github.com/asthewindx/survivor/blob/main/scripts/Script_Manifest.js): `scripts/Script_Manifest.js`

### Survival and combat

- [Player survival](https://github.com/asthewindx/survivor/blob/main/scripts/Core/Player_Basic.js): `scripts/Core/Player_Basic.js`
- [Seasons and weather](https://github.com/asthewindx/survivor/blob/main/scripts/Core/Temp.js): `scripts/Core/Temp.js`
- [Infected combat](https://github.com/asthewindx/survivor/blob/main/scripts/Core/Entity.js): `scripts/Core/Entity.js`
- [Firearms](https://github.com/asthewindx/survivor/blob/main/scripts/Core/Attack.js): `scripts/Core/Attack.js`

### Gameplay systems

- [Block interactions](https://github.com/asthewindx/survivor/blob/main/scripts/Systems/Blocks.js): `scripts/Systems/Blocks.js`
- [Item use and codex](https://github.com/asthewindx/survivor/blob/main/scripts/Systems/Item.js): `scripts/Systems/Item.js`
- [Handheld lighting](https://github.com/asthewindx/survivor/blob/main/scripts/Systems/Light.js): `scripts/Systems/Light.js`

### Player interface

- [Status HUD](https://github.com/asthewindx/survivor/blob/main/scripts/Systems/Hud.js): `scripts/Systems/Hud.js`
- [Debug commands](https://github.com/asthewindx/survivor/blob/main/scripts/Shares/Debug.js): `scripts/Shares/Debug.js`

### Other components

- **Player**

## Connections

- Runtime registration → Player survival: imports (evidence: `scripts/Script_Manifest.js`)
- Runtime registration → Shared state and actions: imports (evidence: `scripts/Script_Manifest.js`)
- Runtime registration → Seasons and weather: imports (evidence: `scripts/Script_Manifest.js`)
- Runtime registration → Debug commands: imports (evidence: `scripts/Script_Manifest.js`)
- Runtime registration → Status HUD: imports (evidence: `scripts/Script_Manifest.js`)
- Runtime registration → Item use and codex: imports (evidence: `scripts/Script_Manifest.js`)
- Runtime registration → Block interactions: imports (evidence: `scripts/Script_Manifest.js`)
- Runtime registration → Firearms: imports (evidence: `scripts/Script_Manifest.js`)
- Runtime registration → Infected combat: imports (evidence: `scripts/Script_Manifest.js`)
- Runtime registration → Handheld lighting: imports (evidence: `scripts/Script_Manifest.js`)
- Firearms → Infected combat: uses hit logic (evidence: `scripts/Core/Attack.js`)
- Firearms → Shared state and actions: uses helpers (evidence: `scripts/Core/Attack.js`)
- Infected combat → Player survival: calls death handling (evidence: `scripts/Core/Entity.js`)
- Infected combat → Shared state and actions: uses helpers (evidence: `scripts/Core/Entity.js`)
- Player survival → Shared state and actions: uses helpers (evidence: `scripts/Core/Player_Basic.js`)
- Seasons and weather → Player survival: calls fatigue handling (evidence: `scripts/Core/Temp.js`)
- Seasons and weather → Shared state and actions: uses helpers (evidence: `scripts/Core/Temp.js`)
- Block interactions → Player survival: calls death handling (evidence: `scripts/Systems/Blocks.js`)
- Block interactions → Seasons and weather: reads season (evidence: `scripts/Systems/Blocks.js`)
- Block interactions → Shared state and actions: uses helpers (evidence: `scripts/Systems/Blocks.js`)
- Item use and codex → Shared state and actions: uses helpers (evidence: `scripts/Systems/Item.js`)
- Status HUD → Item use and codex: reads gun IDs (evidence: `scripts/Systems/Hud.js`)
- Status HUD → Shared state and actions: uses helpers (evidence: `scripts/Systems/Hud.js`)
- Handheld lighting → Item use and codex: reads gun IDs (evidence: `scripts/Systems/Light.js`)
- Handheld lighting → Seasons and weather: reads weather (evidence: `scripts/Systems/Light.js`)
- Handheld lighting → Shared state and actions: uses helpers (evidence: `scripts/Systems/Light.js`)
- Debug commands → Player survival: calls death handling (evidence: `scripts/Shares/Debug.js`)
- Debug commands → Seasons and weather: sets weather (evidence: `scripts/Shares/Debug.js`)
- Debug commands → Shared state and actions: uses helpers (evidence: `scripts/Shares/Debug.js`)
- Player → Player survival: plays through
- Player → Firearms: uses
- Player → Block interactions: interacts
- Player → Item use and codex: uses
