/ban accepts an exact account name (works even when the player is offline) or a player selector like @a[tag=cheater], which only matches players currently online.
Shown on the player's disconnect screen and stored in the ban list. Leave it empty and Minecraft shows the default message: Banned by an operator.
Bans the account Steve even while offline. If they are online, they are kicked immediately.
Run this later from the console or an opped account to lift the ban. The player can rejoin right away.
Blocks one account name. The player can still come back on a different account.
Blocks the connecting IP address, stopping every account on it. Use it for repeat offenders on alt accounts, but note it also hits anyone sharing that connection.
Lifts a name ban. /pardon-ip lifts an IP ban. View both lists with /banlist players and /banlist ips.
Server only: /ban needs operator permission level 3 and is only registered on multiplayer servers. It does not exist in singleplayer or LAN worlds, even with cheats enabled.
The /ban command adds a player to your server's ban list and kicks them on the spot if they are online. It needs operator permission level 3, works on offline players by exact account name, and only exists on multiplayer servers, never in singleplayer worlds.
A ban is permanent until it is lifted. The server writes the entry to banned-players.json in its root folder, so the ban survives restarts and updates. Every time the banned account tries to connect, the login is refused with the message You are banned from this server followed by the reason. If you do not give a reason, Minecraft uses the default text Banned by an operator.
The command takes the account name, not a nickname or display name, and the player does not have to be online: banning by name works on anyone who has ever joined and even on accounts that have not. Target selectors such as @a[tag=cheater] are also accepted, but selectors can only match players who are currently connected.
Use the generator above to compose the command: pick a name or build a selector, type the reason players will see, and copy the result into the server console or chat. The second output gives you the matching /pardon command for when the ban should be lifted.
The full syntax is /ban <targets> [<reason>]. Only the target is required:
Common examples you can copy directly:
All four ban-related commands require operator permission level 3. The default op level on a vanilla server is 4, so any opped player can ban, but if your server.properties lowers op-permission-level below 3, even ops lose access and the command must come from the console.
Minecraft servers keep two separate ban lists, one for account names and one for IP addresses, with a matching pair of commands to add and remove entries:
A name ban is the right first response: it is precise, reversible and never affects bystanders. Its weakness is alt accounts, since nothing stops the same person from buying another copy of the game and joining under a new name. That is what /ban-ip is for: it blocks the connection itself, so every account from that address is refused with Your IP address is banned from this server.
Use IP bans carefully. Home connections often change addresses over time, several players can share one IP (siblings, schools, shared housing), and a determined evader can switch to a VPN anyway. A common pattern is /ban for the account plus /ban-ip while the offender is online, then /pardon-ip later if an innocent player on the same connection gets caught by it.
Run /ban followed by the player's exact account name, for example /ban Steve Griefing the spawn area. Everything after the name becomes the reason shown when they try to join. You need operator permission level 3, so run it from the server console or as an opped player.
Yes. /ban works with the exact account name even when the player is not online, so /ban Steve adds Steve to the ban list immediately. Target selectors like @a only match online players, so always use the plain name to ban someone who has logged off.
Run /pardon with the player's name, for example /pardon Steve, from the console or an opped account. If the player was also IP banned, run /pardon-ip with their IP address. The change applies instantly and the player can join again without a server restart.
/ban blocks one account name, so the player can return on a different account. /ban-ip blocks the connecting IP address, which stops every account on that connection but also affects anyone sharing it. Most servers start with /ban and keep /ban-ip for repeat offenders using alt accounts.
/ban is only registered on multiplayer servers. It does not exist in singleplayer or in worlds opened to LAN, even with cheats enabled. On a server it requires operator permission level 3, so make sure you are opped, and check that you typed the exact account name rather than a nickname.
Name bans are stored in banned-players.json and IP bans in banned-ips.json, both in the server's root folder next to server.properties. Each entry records who was banned, who issued the ban, the date and the reason. In game, view them with /banlist players and /banlist ips.
Need a warning shot instead of a ban? Or browse more Minecraft tools: