# Configuration This page explains the configuration model for Common, Proxy and Paper modules: semantics, required fields, and operational constraints. Configuration files overview - Common App: `./config.json` (same folder as `EndSectors-application.jar`) - Proxy: `plugins/EndSectorsProxy/config.json` - Paper: `plugins/EndSectors/config.json` - Tools plugin: `plugins/EndSectors/config.json` (uses main EndSectors values) Important rules - Credentials consistency: The NATS URL, NATS connection name (optional), Redis host/port/password must be identical in all configuration files. A single character mismatch will break the network. - Name Trinity: a sector's name must match in three places: 1. Velocity's `[servers]` server name in `velocity.toml` 2. Proxy map key (the JSON key inside `sectors`) 3. Paper plugin `currentSector` value - World consistency: The `world` folder specified for sectors must be identical across all sector servers. Common config (high level) - redisHost, redisPort, redisPassword - natsUrl (e.g., `nats://127.0.0.1:4222`) - natsConnectionName (optional but recommended for easier tracing) - security: enable TLS and credentials for production Proxy config (map + network) - connection settings (same Redis/NATS as others) - sectors: nested object grouping by sector type (`SPAWN`, `SECTOR`, `NETHER`, `END`, `QUEUE`, etc.) - each sector entry: - pos1X, pos1Z, pos2X, pos2Z: inclusive boundary coordinates - type: sector type (used for titles/scoreboards) - world: world folder name (must match actual server world) Paper config (local sector settings) - currentSector: the exact sector id (e.g., `spawn_1`) - scoreboardEnabled: boolean - border distances (fine-tune when players are warned or prevented from interacting) - protection and transfer delay timings - scoreboard templates and sectorTitles: use MiniMessage-compatible formats Validation & sanity checks - Coordinate overlap checks: proxy validates overlapping sectors; avoid gaps and misaligned boundaries. - World name checks: `world` name must match server's actual world. - Connection checks: on startup, services verify connectivity to Common; if mismatched credentials are detected, services may reject registration. Config versioning & migration - Add explicit `configVersion` in future releases to simplify migrations. - When changing semantics (e.g., new fields), keep backward-compatible defaults where possible. Example of the Name Trinity - Velocity `velocity.toml`: ```toml [servers] spawn_1 = "127.0.0.1:30001" ``` - Proxy config: ```json "sectors": { "SPAWN": { "spawn_1": { ... } } } ``` - Paper config: ```json { "currentSector": "spawn_1" } ``` Tip: Use a single source of credentials (a secure password manager or env file) and copy-paste across configs to avoid typos. Next: See [Configuration Examples](Config-Examples.md) for concrete JSON files and annotated fields.