> ## Documentation Index
> Fetch the complete documentation index at: https://new-docs.simplecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Server Connection

> Learn how SimpleCloud's server connection plugin handles fallback and connection logic

## Overview

The server connection plugin handles the connection logic for players in your network. This plugin is essential for any Minecraft network that uses SimpleCloud. It acts as the central connection manager for your servers.

<Note>
  This plugin internally uses the server API to track online cloud servers and
  provides interfaces for custom implementations.
</Note>

## Features

The server connection plugin provides:

* **Automatic Fallback**: When a server crashes or shuts down, players are automatically moved to a fallback server
* **Connection Queue**: Manages player connections to prevent overwhelming servers during mass reconnects
* **Server State Awareness**: Only connects players to servers in an appropriate state
* **Customizable Behavior**: Configure fallback priorities and connection rules

## Supported Software

| Software   | Plugin Support | Server API Support |
| ---------- | -------------- | ------------------ |
| Velocity   | ✅ Full         | ✅ Yes              |
| Bungeecord | ✅ Full         | ✅ Yes              |
| Gate       | 🔄 Planned     | ✅ Yes              |

## Quick Setup

1. Download the plugin from [GitHub](https://github.com/simplecloudapp/server-connection-plugin/releases)
2. Place it in your proxy template's plugins folder
3. Start your proxy server
4. Configure using `config.yml`

## Configuration

The plugin's configuration file (`config.yml`) supports the following options:

```yaml theme={null}
version: "1"

connections:
  - name: "lobby"
    server-name-matcher:
      operation: "STARTS_WITH"
      value: "lobby"

network-join-targets:
  enabled: true
  no-target-connection-found-message: "<color:#dc2626>No lobby server is currently available."
  target-connections:
    - name: "lobby"
      priority: 0

fallback-connections-config:
  enabled: true
  no-target-connection-found-message: "<color:#dc2626>You were disconnected because no fallback lobby is available."
  target-connections:
    - name: "lobby"
      priority: 0

commands:
  - name: "lobby"
    aliases:
      - "l"
      - "hub"
      - "leave"
      - "quit"
    already-connected-message: "<color:#fbbf24>You are already connected to the lobby."
    no-target-connection-found: "<color:#dc2626>No lobby server is available."
    target-connections:
      - name: "lobby"
        priority: 0
```

## How It Works

When a player needs to be moved (server shutdown, kick, etc.):

1. The plugin checks for available fallback servers
2. Servers are prioritized by the configured group order
3. The player is connected to the first available server
4. If no server is available, the configured kick message is shown
