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

Switch game

23 Wikis · pick your game
/ban

Command

/ban

Bans one or more players from the server by adding them to the ban list.

Syntax

/ban <targets> [<reason>]

Arguments

ArgumentKind of valueWhat to type
<targets>Player profileThe player or players to ban, as a player name or a player selector.
<reason>MessageOptional text stored with the ban and shown in the ban list. Everything after the name 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 each banned player together with the reason. The number /execute store saves is the number of players newly banned.
Online players are kickedA banned player who is online is disconnected right away with the message "You are banned from this server".
Default reasonWithout a reason, the ban is stored with "Banned by an operator."
Already bannedPlayers who are already banned are skipped. If nobody new was banned, the command fails with "Nothing changed. The player is already banned".
No end dateBans made with this command never expire. Use /pardon to lift one.

Examples

/ban Steve

Bans the player Steve with the default reason.

/ban Steve Griefing the spawn area

Bans Steve and records the reason "Griefing the spawn area".

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)