# Configuration

# Configuration

VoiceHub's configuration is stored in `config.json` inside the mod's data folder.

## Default Configuration

```json
{
  "_info": "KyuubiSoft VoiceHub Configuration",
  "proximity": {
    "enabled": true,
    "maxHearingDistance": 64.0,
    "fullVolumeDistance": 16.0,
    "deadPlayersCanHear": false
  },
  "defaultChannels": [
    {
      "name": "Proximity",
      "description": "Players nearby can hear you",
      "type": "PROXIMITY"
    },
    {
      "name": "Global",
      "description": "Server-wide voice channel",
      "type": "GLOBAL"
    }
  ],
  "channels": {
    "maxChannelsPerPlayer": 3,
    "maxChannelsTotal": 50,
    "maxMembersDefault": 20,
    "allowPlayerCreatedChannels": true,
    "allowGlobalChannels": false,
    "whisperEnabled": true,
    "persistentChannelsEnabled": true,
    "autoDeleteEmptyAfterMinutes": 30
  },
  "permissions": {
    "adminPermission": "kyuubisoft.voicehub.admin",
    "createPermission": "kyuubisoft.voicehub.create"
  }
}
```

## Settings Reference

### Proximity

| Setting | Type | Default | Description |
|---------|------|---------|-------------|
| `enabled` | boolean | `true` | Enable proximity voice |
| `maxHearingDistance` | float | `64.0` | Maximum hearing range in blocks |
| `fullVolumeDistance` | float | `16.0` | Distance at which volume starts to fade |
| `deadPlayersCanHear` | boolean | `false` | Whether dead players can hear voice |

### Default Channels

An array of channels that are automatically created on server start. These channels cannot be deleted by players.

| Field | Type | Description |
|-------|------|-------------|
| `name` | string | Display name of the channel |
| `description` | string | Channel description |
| `type` | string | Channel type: `PROXIMITY`, `GROUP`, `GLOBAL`, `MODERATED`, `WHISPER` |

### Channels

| Setting | Type | Default | Description |
|---------|------|---------|-------------|
| `maxChannelsPerPlayer` | int | `3` | Maximum channels a player can own |
| `maxChannelsTotal` | int | `50` | Maximum total channels on the server |
| `maxMembersDefault` | int | `20` | Default member limit for new channels |
| `allowPlayerCreatedChannels` | boolean | `true` | Whether players can create channels |
| `allowGlobalChannels` | boolean | `false` | Whether GLOBAL type channels are allowed |
| `whisperEnabled` | boolean | `true` | Whether whisper channels are allowed |
| `persistentChannelsEnabled` | boolean | `true` | Whether channels can persist across restarts |
| `autoDeleteEmptyAfterMinutes` | int | `30` | Auto-delete empty non-persistent channels after X minutes |

### Permissions

| Setting | Type | Default | Description |
|---------|------|---------|-------------|
| `adminPermission` | string | `kyuubisoft.voicehub.admin` | Permission for admin commands and panel |
| `createPermission` | string | `kyuubisoft.voicehub.create` | Permission required when `allowPlayerCreatedChannels` is `false` |

:::tip Player Channel Creation
When `allowPlayerCreatedChannels` is `true` (default), all players can create channels without any permission. The `createPermission` is only checked when `allowPlayerCreatedChannels` is `false`.
:::

## Database

VoiceHub uses SQLite for persistence. The database file `voicehub.db` is stored in the mod's data folder and contains:

- **channels** — persistent channel configurations
- **channel_members** — member lists for persistent channels
- **channel_permissions** — moderator assignments
- **player_settings** — per-player preferences (last channel, voice enabled)