Skip to content
WikilyWIKILY
All games23 Wikis · pick your game
Commands and cheatsAll commands

Switch game

23 Wikis · pick your game
/ban-ip

Command

/ban-ip

Bans an IP address from the server so that nobody can join from it.

Syntax

/ban-ip <target> [<reason>]

Arguments

ArgumentKind of valueWhat to type
<target>TextAn IP address, or the name of an online player whose address should be banned. A single word without spaces. One word without spaces.
<reason>MessageOptional text stored with the ban. Everything after the target is used as the reason.

Details

Permission level3: server operators with level 3 or higher
Works inDedicated 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.
ResultReports 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 nameThe 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 kickedAll online players connected from the banned address are disconnected with "You have been IP banned from this server".
Failure reasonsFails 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 reasonWithout a reason, the ban is stored with "Banned by an operator." Use /pardon-ip to lift it.

Examples

/ban-ip 203.0.113.25

Bans the IP address 203.0.113.25.

/ban-ip Steve Using multiple accounts

Bans the IP address Steve is connected from and records the reason.

Join the creator communityThe people who build the Minecraft Java Edition wiki are on our Discord. Ask questions or suggest pages.Join Discord (opens Discord in a new tab)