# How to Ban and Unban Players on Your Minecraft Server (/docs/minecraft/ban-unban-players)



import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
import { Step, Steps } from 'fumadocs-ui/components/steps';

Banning removes a player and prevents them from rejoining. Minecraft supports two ban types: **username bans** (most common) and **IP bans** (catches alt accounts from the same connection).

Ban a Player [#ban-a-player]

<Tabs items={['Via Console (Recommended)', 'In-Game with OP']}>
  <Tab value="Via Console (Recommended)">
    <Steps>
      <Step>
        Open the Console [#open-the-console]

        In the [XGamingServer Panel](https://panel.xgamingserver.com), click **Console** in the sidebar.
      </Step>

      <Step>
        Run the ban command [#run-the-ban-command]

        ```
        ban PlayerName Reason for the ban
        ```

        The reason is optional but recommended — it's shown to the player when they try to reconnect.
      </Step>
    </Steps>
  </Tab>

  <Tab value="In-Game with OP">
    If you have OP permissions, you can ban from in-game chat:

    ```
    /ban PlayerName Toxic behavior in chat
    ```
  </Tab>
</Tabs>

Unban a Player [#unban-a-player]

```
pardon PlayerName
```

The player can immediately reconnect.

IP Bans [#ip-bans]

For repeat offenders who keep making new accounts, ban their IP address instead:

```
ban-ip 123.45.67.89 DDoS attempts
```

Or ban by username (the server looks up their last known IP):

```
ban-ip PlayerName Multiple alt accounts
```

To unban an IP:

```
pardon-ip 123.45.67.89
```

> **Tip:** Banning by username is preferred for normal cases. IP bans catch alt accounts from the same connection, but they also block legitimate players sharing that IP (e.g., siblings on the same home network, university dorms).

Command Reference [#command-reference]

| Command                        | Description                              |
| ------------------------------ | ---------------------------------------- |
| `ban <player> [reason]`        | Ban a player by username                 |
| `ban-ip <ip\|player> [reason]` | Ban an IP address                        |
| `pardon <player>`              | Unban a player by username               |
| `pardon-ip <ip>`               | Unban an IP address                      |
| `banlist players`              | View all banned players                  |
| `banlist ips`                  | View all banned IP addresses             |
| `kick <player> [reason]`       | Kick (temporary, can rejoin immediately) |

Edit Ban Files Directly [#edit-ban-files-directly]

Ban lists are stored as JSON files in your server root:

| File                  | Contents        |
| --------------------- | --------------- |
| `banned-players.json` | Username bans   |
| `banned-ips.json`     | IP address bans |

You can edit these directly via **Files** in the panel:

```json
[
  {
    "uuid": "069a79f4-44e9-4726-a5be-fca90e38aaf5",
    "name": "BadActor",
    "created": "2026-01-15 12:34:56 +0000",
    "source": "AdminName",
    "expires": "forever",
    "reason": "Griefing spawn"
  }
]
```

After editing, use `banlist players` in the **Console** to verify, or restart the server.

Temporary Bans [#temporary-bans]

Vanilla Minecraft doesn't support temporary bans natively — bans are always permanent until manually removed. For tempbans, install a plugin:

* **EssentialsX** — `/tempban <player> <duration> <reason>` syntax
* **LiteBans** — Advanced ban management with web UI
* **AdvancedBan** — Tempbans, mutes, warnings, kicks

Best Practices [#best-practices]

| Practice                         | Why                                                                  |
| -------------------------------- | -------------------------------------------------------------------- |
| **Always include a reason**      | The reason is shown to the banned player and helps with appeals      |
| **Use username bans by default** | Cleaner — IP bans catch innocent users on shared connections         |
| **Document bans externally**     | Keep a Discord channel or spreadsheet of bans with dates and reasons |
| **Warn before banning**          | For minor offenses, kick first with a warning                        |

Related Guides [#related-guides]

* [OP Permissions](/docs/minecraft/op-permissions)
* [Whitelist Setup](/docs/minecraft/whitelist-setup)
* [EssentialsX Setup](/docs/minecraft/setup-essentialsx)
