
Command
/ban
Bans one or more players from the server by adding them to the ban list.
| /ban <targets> [<reason>] |
| Argument | Kind of value | What to type |
|---|---|---|
| <targets> | Player profile | The player or players to ban, as a player name or a player selector. |
| <reason> | Message | Optional text stored with the ban and shown in the ban list. Everything after the name 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 each banned player together with the reason. The number /execute store saves is the number of players newly banned. |
| Online players are kicked | A banned player who is online is disconnected right away with the message "You are banned from this server". |
| Default reason | Without a reason, the ban is stored with "Banned by an operator." |
| Already banned | Players who are already banned are skipped. If nobody new was banned, the command fails with "Nothing changed. The player is already banned". |
| No end date | Bans made with this command never expire. Use /pardon to lift one. |
/ban SteveBans the player Steve with the default reason.
/ban Steve Griefing the spawn areaBans Steve and records the reason "Griefing the spawn area".

