Commands/ban

From Minecraft Wiki
< Commands(Redirected from Commands/ban-ip)
Jump to: navigation, search
Information icon.svg
This feature is exclusive to Java Edition.

These commands control a server's banlist, or blacklist. A blacklist is a list of players or IP addresses that are not allowed to connect to the server. Bans supersede any whitelisting in place.

ban[edit]

ban
Restrictions

Multiplayer
Operator
No command blocks

First introduced

Java Edition Alpha v1.0.16

Adds a player to the blacklist.

Syntax[edit]

ban <targets> [<reason>]

Arguments[edit]

<targets>

Name of the player to be added to the blacklist. Must be a player name, a target selector or a UUID. Does not have to be online or even real.
Entities other than players are not allowed.

<reason>

Message to display to the banned player, to other operators, and in the server logs. May include spaces as well as target selectors.

Result[edit]

Fails if any target selectors in either argument fail to resolve to at least one online player.

On success, the player(s) is added to the server blacklist, which prevents anyone with that name from connecting to the server.

ban-ip[edit]

ban-ip
Restrictions

Multiplayer
Operator
No command blocks

First introduced

Java Edition Alpha v1.0.16

Adds an IP address to the blacklist.

Syntax[edit]

ban-ip <target> [<reason>]

Arguments[edit]

<target>

An IP address or name of an online player.

<reason>

A message to display to the banned player, to other operators, and in the server logs. May include spaces as well as target selectors.

Result[edit]

Fails if either the IP address or player name is invalid, or if any target selectors in <reason> fail to resolve to at least one online player.

On success, the narrowly-specified address or that of the named, online player is added to the server blacklist, preventing anyone from connecting to the server from that address.

banlist[edit]

banlist
Restrictions

Multiplayer
Operator
No command blocks

First introduced

Java Edition Alpha v1.0.16

Displays the server's blacklist.

Syntax[edit]

banlist [ips|players]

Result[edit]

Always succeeds. Displays banned IP addresses or banned players.

banip[edit]

banip
Restrictions

Operator

First introduced

Java Edition Classic 0.0.15a (Multiplayer Test 3)

Removed

JE Indev 0.31

Rose (2D).png
This section describes content that only exists in outdated versions of Minecraft.
This feature used to be in the game but has since been removed.

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]

banip (<address>|<name>) [<reason>]

History[edit]

Java Edition Classic
0.0.15a (Multiplayer Test 3)Added /ban and /banip.
Java Edition Indev
0.31Removed all commands.
Java Edition Alpha
v1.0.16Re-added /ban.
Added /ban-ip and /banlist.

See also[edit]