NPC Data Structure
NPCs (Non-Player Characters) and mobs are defined in JSON manifests and loaded at runtime. This data-driven approach allows content to be modified without code changes.NPC data is managed in
packages/shared/src/data/npcs.ts and loaded from world/assets/manifests/npcs.json.Data Loading
NPCs are NOT hardcoded. TheALL_NPCS map is populated at runtime:
NPC Data Schema
Each NPC has the following structure:NPC Categories
Aggression Types
NPCs have different aggression behaviors:Aggro Rules
Drop Tables
Each NPC has aDropTable defining loot:
Drop Calculation
Available 3D Models
NPCs use rigged VRM models from/assets/models/:
Helper Functions
Get NPC by ID
Get NPCs by Category
Get NPCs by Biome
Get NPCs by Level Range
Check if NPC Can Drop Item
Combat Level Calculation
NPC combat level is calculated from stats:Spawn Constants
Global spawn settings:Example NPC Definition
Adding New NPCs
1
Add to JSON Manifest
Add entry to
world/assets/manifests/npcs.json2
Choose or Create Model
Use existing model or generate new one in 3D Asset Forge
3
Restart Server
Server must restart to reload manifests