/ban
These commands add a single or multiple players into the server's ban list (or blacklist) by their game profile or IP address. A ban list is a list of players or IP addresses that are not allowed to connect to the server; this list supersede any whitelisting in place.
To remove players from the ban list, operator may use /pardon or manually removing it from the banned-players.json.
ban
[edit | edit source]/ban| Permission level required |
3 |
|---|---|
| Restrictions | Dedicated server |
{
"title": "<code>/ban</code>",
"rows": [
{
"field": "3",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "Dedicated server<br>",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Adds the player profile(s) into the server blacklist, which prevents anyone from connecting to the server with uuids of these profiles.
Syntax
[edit | edit source]ban <targets> [<reason>]
Arguments
[edit | edit source]<targets>: game_profile
- Specifies the player profile(s) to be added to the blacklist.
- Specifies one or more game profiles (player profiles). Must be a player name (should be a real one if the server is in online mode) or a player-type target selector.
<reason>: message
- Message to display to the banned player, to other operators, and in the server logs. If unspecified, defaults to
Banned by an operator. - It is a greedy phrase string argument (taking the rest of the command as the string argument). Can include spaces as well as target selectors. The game replaces entity selectors in the message with the list of selected entities' names, which is formatted as "name1 and name2" for two entities, or "name1, name2, ... and namen" for n entities.
Result
[edit | edit source]
| Command | Trigger | Java Edition |
|---|---|---|
| Any | The command is incomplete, or any argument is not specified correctly. | Unparseable |
| The target selector fails to resolve to one or more online players. | Failed | |
| Does not add any new player profile to blacklist. | ||
| Otherwise | Successful |
Output
[edit | edit source]
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
| Any | Java Edition | On fail | N/A | 0 | 0 |
| On success | N/A | 1 | the number of new player names added to blacklist. |
ban-ip
[edit | edit source]/ban-ip| Permission level required |
3 |
|---|---|
| Restrictions | Dedicated server |
{
"title": "<code>/ban-ip</code>",
"rows": [
{
"field": "3",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "Dedicated server<br>",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Adds an IP address to the blacklist. Adds the narrowly-specified address or address of the named online player into the server blacklist, preventing anyone from connecting to the server from that address.
Syntax
[edit | edit source]ban-ip <target> [<reason>]
Arguments
[edit | edit source]<targets>: string
- Specifies the IP address to be added to the blacklist. Can also be a name of an online player, which represents the IP of that player.
- Must be a string. And it must be in a single word (Allowed characters include:
-,+,.,_,A-Z,a-z, and0-9).
<reason>: message
- Message to display to the banned player, to other operators, and in the server logs. If unspecified, defaults to
Banned by an operator. - It is a greedy phrase string argument (taking the rest of the command as the string argument). Can include spaces as well as target selectors. The game replaces entity selectors in the message with the list of selected entities' names, which is formatted as "name1 and name2" for two entities, or "name1, name2, ... and namen" for n entities.
Result
[edit | edit source]
| Command | Trigger | Java Edition |
|---|---|---|
| Any | The command is incomplete, or any argument is not specified correctly. | Unparseable |
targets is not a valid IP, nor a name of an online player. | Failed | |
| Does not add any new IP address to blacklist. | ||
| Otherwise | Successful |
Output
[edit | edit source]
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
| Any | Java Edition | On fail | N/A | 0 | 0 |
| On success | N/A | 1 | the number of online players that connecting with the specified IP |
banlist
[edit | edit source]/banlist| Permission level required |
3 |
|---|---|
| Restrictions | Dedicated server |
{
"title": "<code>/banlist</code>",
"rows": [
{
"field": "3",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "Dedicated server<br>",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Displays the server's blacklist.
Syntax
[edit | edit source]banlist [ips|players]
Result
[edit | edit source]
| Command | Trigger | Java Edition |
|---|---|---|
| Any | The command is incomplete. | Unparseable |
| Otherwise | Successful |
Output
[edit | edit source]
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
| Any | Java Edition | On success | N/A | 1 | the number of entries in the specified list. |
banip
[edit | edit source]/banip| Permission level required |
Unknown |
|---|---|
| Restrictions | None |
{
"title": "<code>/banip</code>",
"rows": [
{
"field": "Unknown",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "None",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Bans a player by IP number. Cannot be undone in-game; banned-ip.txt must manually be changed.
The Classic equivalent of /ban-ip.
Syntax
[edit | edit source]banip (<address>|<name>) [<reason>]
History
[edit | edit source]| Java Edition Classic | |||||||
|---|---|---|---|---|---|---|---|
| 0.0.16a | Added /ban and /banip. | ||||||
| Java Edition Indev | |||||||
| 0.31 | Due to Indev's lack of support for servers, commands are no longer usable. | ||||||
| Java Edition Alpha | |||||||
| v1.0.16 | /banip has been renamed to /ban-ip.
| ||||||
/ban and /ban-ip are now usable again.
| |||||||
Added /banlist. | |||||||