Stored in banned-ips.json and shown to anyone from that address who tries to join. Leave empty for the default, "Banned by an operator."
No reason set: banned players see "Banned by an operator." Run from the server console or as an operator (permission level 3).
Removes this address from banned-ips.json. Takes effect immediately, no restart needed.
One IPv4 address often covers more than one person: siblings, classmates or a whole shared network. Dynamic addresses also rotate over time, so an old IP ban can hit an innocent player later. For punishing a single account, use /ban instead.
The /ban-ip command blocks every connection from one IP address. Give it a raw IPv4 address or the name of an online player, add an optional reason, and the server writes the ban to banned-ips.json and kicks everyone currently connected from that address.
When someone on a banned address tries to join, the connection is refused before they ever load in, and the disconnect screen shows your reason. If you skip the reason, the game falls back to Banned by an operator. The player-name form is the practical one mid-incident: while the troublemaker is still online, /ban-ip TheirName resolves whatever address they are connected from and bans it in one step, no log digging required.
Running it requires permission level 3, so any operator on a default server (ops get level 4) and the server console both qualify. The command exists on multiplayer servers only: singleplayer worlds and LAN sessions never register the ban commands. The ban itself has no expiry; it stays in banned-ips.json until you remove it with /pardon-ip.
The full syntax, straight from the game's command tree:
/ban-ip <target> [<reason>]Copy-ready examples:
/ban-ip 198.51.100.7Bans one IPv4 address with the default reason, Banned by an operator./ban-ip 198.51.100.7 Repeated griefing at spawnBans the address and shows the custom reason on the disconnect screen./ban-ip SteveLooks up the online player Steve and bans the IP address they are connected from./ban-ip Steve Ban evasion on an alt accountPlayer-name form with a reason. Steve must be online when the command runs./pardon-ip 198.51.100.7The undo: removes the address from banned-ips.json so it can connect again.Minecraft servers keep two separate ban lists, and picking the right one matters:
Use /ban-ip when one person keeps coming back on fresh alt accounts: the IP ban catches every account from that connection at once. Use /ban for ordinary rule breaking, because an IP ban can be wider than you intend. Shared households, schools and public networks put many players behind one address, and dynamic IPs get reassigned, so an old entry in banned-ips.json can lock out someone who did nothing wrong.
To audit what is currently blocked, run /banlist ips for addresses and /banlist players for accounts. Both lists are plain JSON files in the server folder, so you can also review or edit them with the server stopped. And since IP bans are easy to dodge with a VPN, treat them as one layer: serious protection for a private server comes from combining account bans, IP bans and a whitelist.
Run /ban-ip followed by the address, for example /ban-ip 198.51.100.7, from the server console or as an operator with permission level 3. You can add a reason after the address, and you can pass the name of an online player instead of an address to ban whatever IP they are currently connected from.
/ban blocks a single account by its game profile and writes it to banned-players.json, so the player stays banned even when they connect from a new network. /ban-ip blocks an address and writes it to banned-ips.json, which stops every account connecting from that IP but does nothing once the offender moves to a different address. Many admins use both together for serious offenders.
Java Edition validates the target against an IPv4 pattern: four numbers from 0 to 255 separated by dots. Anything else, including IPv6 addresses, hostnames or an address with a typo, fails with that error unless it matches the name of a player who is currently online. Double-check the address, or ban the player by name while they are connected.
Run /pardon-ip followed by the exact address, for example /pardon-ip 198.51.100.7. Use /banlist ips to list every banned address first. You can also stop the server and delete the entry from banned-ips.json by hand; both methods lift the ban cleanly.
No. The ban family of commands (/ban, /ban-ip, /banlist, /pardon and /pardon-ip) is only registered on dedicated multiplayer servers. In singleplayer or on a LAN world the commands do not exist; if you need real bans, you need to run a server.
Yes. A VPN, a proxy or even a router restart on a dynamic connection gives a player a fresh address, so a determined ban evader will get past a plain IP ban. Combine /ban-ip with account bans, and for private servers a whitelist is the only airtight option.
Banning an account instead of an address? Or browse more Minecraft tools: