
Command
/ban-ip
Bans an IP address from the server so that nobody can join from it.
| /ban-ip <target> [<reason>] |
| Argument | Kind of value | What to type |
|---|---|---|
| <target> | Text | An IP address, or the name of an online player whose address should be banned. A single word without spaces. One word without spaces. |
| <reason> | Message | Optional text stored with the ban. Everything after the target is used as the reason. |
| Permission level | 3: server operators with level 3 or higher |
| Works in | Dedicated multiplayer servers only. It does not exist in singleplayer or in worlds opened to LAN. Needs permission level 3 (admins). Command blocks and functions run at level 2 and cannot use it. |
| Result | Reports the banned IP address and the reason, and lists the online players affected by it. The number /execute store saves is the number of online players that were disconnected. |
| Address or player name | The target can be an IP address or the name of a player who is online. With a name, that player's current IP address is banned. |
| Everyone on that address is kicked | All online players connected from the banned address are disconnected with "You have been IP banned from this server". |
| Failure reasons | Fails with "Invalid IP address or unknown player" if the target is neither a valid address nor an online player, and with "Nothing changed. That IP is already banned" if the address is already on the list. |
| Default reason | Without a reason, the ban is stored with "Banned by an operator." Use /pardon-ip to lift it. |
/ban-ip 203.0.113.25Bans the IP address 203.0.113.25.
/ban-ip Steve Using multiple accountsBans the IP address Steve is connected from and records the reason.

