# 🧠 Main

It includes common Velocity network commands such as alerts, player lookup, global player lists, server switching, player sending, proxy shutdown, and Velocity utility commands.

{% hint style="info" %}
The Main module is enabled by default.
{% endhint %}

***

### What It Does

The Main module centralizes essential proxy management commands.

It is useful for:

* Sending network-wide alerts
* Sending raw formatted alerts
* Finding players across the network
* Viewing global player lists
* Viewing proxy player lists
* Sending players to backend servers
* Switching between backend servers
* Running controlled proxy shutdowns
* Accessing Velocity utility commands

***

### When To Enable It

You should keep this module enabled if you want NexusProxy to handle the main administrative commands for your Velocity network.

This module is recommended for almost every setup.

***

### Requirements

The Main module does not require external dependencies.

| Dependency     | Required |
| -------------- | -------- |
| Redis          | No       |
| MySQL          | No       |
| MongoDB        | No       |
| PacketEvents   | No       |
| Discord        | No       |
| PlaceholderAPI | No       |

***

### Configuration File

The Main module configuration file is located at:

```
plugins/NexusProxy/modules/main/main.yml
```

This file can contain settings for:

* Module status
* Command names
* Command aliases
* Permissions
* Messages
* Command behavior

{% hint style="warning" %}
Command names and aliases may be configurable in the module file.

The commands shown here are the default commands.
{% endhint %}

***

### Default Commands

| Command             | Description                                         |
| ------------------- | --------------------------------------------------- |
| `/alert`            | Sends a network-wide alert message.                 |
| `/alertraw`         | Sends a raw formatted network-wide alert.           |
| `/find`             | Finds the current location of a player.             |
| `/glist`            | Shows the global player list.                       |
| `/plist`            | Shows the proxy player list.                        |
| `/send`             | Sends a player to another backend server.           |
| `/server`           | Allows switching or viewing backend servers.        |
| `/shutdown`         | Shuts down the proxy using the configured behavior. |
| `/velocity plugins` | Shows Velocity plugin information.                  |
| `/velocity info`    | Shows Velocity proxy information.                   |
| `/velocity reload`  | Reloads Velocity.                                   |
| `/velocity sudo`    | Forces a player to run a command.                   |
| `/velocity uptime`  | Shows proxy uptime.                                 |

***

### Command Aliases

Depending on your configuration, commands may have aliases.

Check the Main module YAML file to view or edit aliases:

```
plugins/NexusProxy/modules/main/main.yml
```

***

### Permissions

| Permission                           | Description                                       |
| ------------------------------------ | ------------------------------------------------- |
| `nexusproxy.command.alert`           | Allows usage of `/alert`.                         |
| `nexusproxy.command.alertraw`        | Allows usage of `/alertraw`.                      |
| `nexusproxy.command.find`            | Allows usage of `/find`.                          |
| `nexusproxy.command.glist`           | Allows usage of `/glist`.                         |
| `nexusproxy.command.plist`           | Allows usage of `/plist`.                         |
| `nexusproxy.command.send`            | Allows usage of `/send`.                          |
| `nexusproxy.command.server`          | Allows usage of `/server`.                        |
| `nexusproxy.command.shutdown`        | Allows usage of `/shutdown`.                      |
| `velocity.command.plugins`           | Allows usage of Velocity plugin command features. |
| `velocity.command.info`              | Allows usage of Velocity info command features.   |
| `velocity.command.reload`            | Allows usage of Velocity reload command features. |
| `nexusproxy.command.velocity.sudo`   | Allows usage of Velocity sudo command features.   |
| `nexusproxy.command.velocity.uptime` | Allows usage of Velocity uptime command features. |

***

### Recommended LuckPerms Setup

For server owners, give basic server management permissions only to trusted staff.

Example admin group:

```
/lp group admin permission set nexusproxy.command.alert true
/lp group admin permission set nexusproxy.command.alertraw true
/lp group admin permission set nexusproxy.command.find true
/lp group admin permission set nexusproxy.command.glist true
/lp group admin permission set nexusproxy.command.plist true
/lp group admin permission set nexusproxy.command.send true
/lp group admin permission set nexusproxy.command.server true
/lp group admin permission set nexusproxy.command.shutdown true
/lp group admin permission set velocity.command.plugins true
/lp group admin permission set velocity.command.info true
/lp group admin permission set velocity.command.reload true
/lp group admin permission set nexusproxy.command.velocity.sudo true
/lp group admin permission set nexusproxy.command.velocity.uptime true
```

{% hint style="danger" %}
Be careful with `/shutdown`, `/velocity reload`, and `/velocity sudo`.

These commands should only be given to highly trusted administrators.
{% endhint %}

***

### Common Use Cases

#### Send a network alert

```
/alert The network will restart in 5 minutes.
```

#### Find a player

```
/find Notch
```

#### View global players

```
/glist
```

#### Send a player to a server

```
/send Notch lobby
```

#### Switch to another backend server

```
/server survival
```

***

### Setup Tips

* Keep this module enabled unless you use another plugin for all core proxy commands.
* Review all permissions before giving them to staff groups.
* Avoid giving shutdown and sudo permissions to lower staff ranks.
* Check the module YAML file if you want to change command names or aliases.
* Use LuckPerms to manage access cleanly by staff rank.

***

### Common Issues

#### A command does not work

Check that:

* The Main module is enabled.
* The command is not disabled or renamed in the module configuration.
* The player has the required permission.
* Another plugin is not overriding the same command.

***

#### A player cannot use a command

Check that:

* The permission is assigned correctly.
* The permission is assigned on the proxy context if your LuckPerms setup uses contexts.
* The command name was not changed in the module YAML file.

***

#### Another plugin is using the same command

If another plugin registers the same command, edit the command name or aliases in the module configuration file.

```
plugins/NexusProxy/modules/main/main.yml
```

***

### Summary

The Main module is the foundation of NexusProxy's proxy command system.

It provides the default administrative tools most Velocity networks need and should usually remain enabled.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nexusproxy.nemesismc.net/modules/main.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
