# 📶 Ping

It allows players to check their own ping, staff or permitted users to check another player's ping, and other NexusProxy systems to use ping-related placeholders.

***

### What It Does

The Ping module adds ping utilities to your Velocity network.

It can be used for:

* Checking your own ping
* Checking another player's ping
* Showing ping with color formatting
* Comparing ping between players
* Using ping placeholders in NexusProxy messages
* Displaying ping information in proxy-side systems

***

### When To Enable It

Enable this module if you want NexusProxy to provide a simple ping command and ping placeholders.

This module is useful for:

* Player diagnostics
* Staff troubleshooting
* Network latency checks
* Lobby messages
* Announcements
* Placeholder-based displays
* Ping comparison features

***

### Requirements

The Ping module does not require external dependencies.

| Dependency     | Required | Purpose                                        |
| -------------- | -------- | ---------------------------------------------- |
| Redis          | No       | Not required.                                  |
| MySQL          | No       | Not required.                                  |
| MongoDB        | No       | Not required.                                  |
| PacketEvents   | No       | Not required.                                  |
| Discord        | No       | Not required.                                  |
| PlaceholderAPI | No       | Not required for proxy-side ping placeholders. |

{% hint style="info" %}
The Ping module can be used by NexusProxy's proxy-side placeholder system.
{% endhint %}

***

### Configuration File

The Ping module configuration file is located at:

```
plugins/NexusProxy/modules/ping/ping.yml
```

This file can contain settings for:

* Module status
* Command names
* Command aliases
* Permissions
* Ping messages
* Other-player ping messages
* Color thresholds
* Difference formatting
* Placeholder formatting

{% 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                  |
| ---------------- | ---------------------------- |
| `/ping`          | Shows your own ping.         |
| `/ping <player>` | Shows another player's ping. |

***

### Permissions

| Permission                       | Description                                                  |
| -------------------------------- | ------------------------------------------------------------ |
| `nexusproxy.command.ping`        | Allows usage of `/ping`.                                     |
| `nexusproxy.command.ping.others` | Allows checking another player's ping with `/ping <player>`. |

***

### Recommended LuckPerms Setup

#### Default players

```
/lp group default permission set nexusproxy.command.ping true
```

#### Staff

```
/lp group staff permission set nexusproxy.command.ping true
/lp group staff permission set nexusproxy.command.ping.others true
```

{% hint style="info" %}
Most networks give normal players access to their own ping and reserve other-player ping checks for staff.
{% endhint %}

***

### Checking Your Own Ping

Players can check their own ping with:

```
/ping
```

Example output concept:

```
Your ping is 42ms.
```

The exact message format depends on your `ping.yml` configuration.

***

### Checking Another Player's Ping

Players with the correct permission can check another player's ping.

Command:

```
/ping <player>
```

Example:

```
/ping Steve
```

Required permission:

```
nexusproxy.command.ping.others
```

Example output concept:

```
Steve's ping is 58ms.
```

***

### Ping Color Formatting

The Ping module can support colored ping output depending on your configuration.

This is useful for quickly showing connection quality.

Example concept:

```yaml
colors:
  good:
    max: 80
    color: "&a"
  medium:
    max: 150
    color: "&e"
  bad:
    max: 999
    color: "&c"
```

Possible display:

```
Ping: 42ms
Ping: 130ms
Ping: 250ms
```

{% hint style="info" %}
Color thresholds depend on your `ping.yml` configuration.
{% endhint %}

***

### Ping Placeholders

The Ping module can be used with NexusProxy placeholders.

Proxy-side ping placeholders include:

| Placeholder                                   | Description                                                      |
| --------------------------------------------- | ---------------------------------------------------------------- |
| `%nexusproxy_ping%`                           | Shows the player's ping.                                         |
| `%nexusproxy_coloured_ping%`                  | Shows the player's ping with color formatting.                   |
| `%nexusproxy_ping_<player>%`                  | Shows another player's ping.                                     |
| `%nexusproxy_coloured_ping_<player>%`         | Shows another player's ping with color formatting.               |
| `%nexusproxy_difference_<player>%`            | Shows the ping difference between the viewer and another player. |
| `%nexusproxy_difference_<player1>_<player2>%` | Shows the ping difference between two players.                   |

***

### Placeholder Examples

#### Own ping

```
%nexusproxy_ping%
```

***

#### Own colored ping

```
%nexusproxy_coloured_ping%
```

***

#### Another player's ping

```
%nexusproxy_ping_Steve%
```

***

#### Another player's colored ping

```
%nexusproxy_coloured_ping_Steve%
```

***

#### Ping difference with another player

```
%nexusproxy_difference_Steve%
```

***

#### Ping difference between two players

```
%nexusproxy_difference_Steve_Alex%
```

***

### Common Use Cases

#### Check your ping

```
/ping
```

***

#### Check another player's ping

```
/ping Steve
```

***

#### Give players access to `/ping`

```
/lp group default permission set nexusproxy.command.ping true
```

***

#### Give staff access to check other players

```
/lp group staff permission set nexusproxy.command.ping.others true
```

***

### Setup Tips

* Give `/ping` to normal players.
* Give `/ping <player>` only to staff or trusted groups.
* Configure color thresholds to match your network standards.
* Use colored ping placeholders for clean visual feedback.
* Use ping difference placeholders for comparison displays.
* Check `ping.yml` if you want to change command names, aliases, messages, or colors.
* Test placeholders with the Placeholders module before using them in public messages.

***

### Common Issues

#### `/ping` does not work

Check that:

* The Ping module is enabled.
* The player has `nexusproxy.command.ping`.
* The command was not renamed in `ping.yml`.
* Another plugin is not overriding `/ping`.

***

#### Player cannot check another player's ping

Check that:

* The player has `nexusproxy.command.ping.others`.
* The target player is online.
* The command syntax is correct.
* The Ping module is enabled.

***

#### Ping placeholder does not work

Check that:

* The Ping module is enabled.
* The Placeholders module is enabled if using proxy-side placeholder parsing.
* The placeholder is typed correctly.
* The target player name is correct if using another-player placeholders.

***

#### Colored ping looks wrong

Check that:

* Color thresholds are configured correctly.
* Formatting codes are valid.
* The placeholder or message supports color formatting.
* NexusProxy was reloaded or restarted after editing `ping.yml`.

***

#### Another plugin is using `/ping`

If another plugin registers the same command or alias, change the command name or aliases in:

```
plugins/NexusProxy/modules/ping/ping.yml
```

***

### Summary

The Ping module provides a simple ping command and ping placeholders for NexusProxy.

It is recommended for networks that want players to check latency, staff to inspect player ping, or proxy-side systems to display ping information.


---

# 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/ping.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.
