Server Commands
Commands for server administration, player management, and maintenance.
/banBans a player from the server. Banned players cannot connect until unbanned.
/deopRevokes operator status from a player.
/kickDisconnects a player from the server. Unlike /ban, the player can rejoin immediately.
/listShows all players currently connected to the server, optionally with their UUIDs.
/opGrants operator status to a player, giving them permission to use server commands.
/reloadReloads all data packs, advancements, functions, loot tables, predicates, recipes, and tags from disk.
/save-allForces the server to save all chunks and player data to disk. The flush option ensures data is written synchronously.
/stopGracefully shuts down the server, saving all data before stopping.
/whitelistManages the server whitelist. When enabled, only whitelisted players can join the server.
Permission levels
Every command on this site lists the permission level it needs. On a server, /op gives a player the level set by op-permission-level in server.properties, which is 4 unless you changed it. Each entry in ops.json has its own level, so by editing that file a helper can sit at 2 while you keep 4. /deop takes operator status away again, and both commands need level 3.
- Level 1, moderator
- The player may build inside spawn protection, the area around world spawn that spawn-protection sets. The default of 16 covers a 33 by 33 square, and on a server without operators the protection is off.
- Level 2, game master
- Most commands, like /gamemode, /give and /tp, plus command blocks, the F3+F4 and F3+N shortcuts and /reload.
- Level 3, admin
- Player management: /op, /deop, /ban, /kick, /whitelist,
/transferand/setidletimeout.
Whitelist and bans
/whitelist on lets only listed players join, and /whitelist add works for someone who isn't online. Operators on Java Edition always get in, whether they are on the list or not. Players who are already online stay, unless enforce-whitelist is true in server.properties. Then anyone missing from the list is kicked as soon as the server reloads the whitelist, for example after /whitelist reload. Run that one after editing whitelist.json by hand as well, because it is what makes the server read the file again.
/ban writes a player to banned-players.json, and the ban list wins over the whitelist, so a banned player stays out even with their name on it. Without a reason the message is "Banned by an operator." /pardon lifts a ban, /ban-ip blocks an address instead of a name and /banlist shows who and what is banned. /kick only disconnects someone, who can join again straight away. The host of a LAN world can't be kicked at all.
Saving and backups
Plain /save-all writes player data straight away and marks every chunk as needing a save, and the chunks then reach the disk over time. /save-all flush writes players and chunks at once, and the server freezes briefly while it does.
To back up a world while the server keeps running, turn saving off with /save-off, run /save-all flush, copy the world folder and finish with /save-on. While saving is off, changes to the world wait in a queue. Player, advancement and statistics files are still written, and a restart switches saving back on by itself. /stop saves everything and disconnects all players before the server shuts down.
What /reload does
/reload reads the data packs again: functions, recipes, loot tables, advancements, tags and the rest of what a pack holds. When a pack has invalid data, such as a broken recipe, the change doesn't apply and the game carries on with the data it already had. Changes to server.properties aren't picked up, because the server only reads that file when it starts. /reload needs level 2, and how functions work is covered with the logic commands.
Who is online, and sending players on
/list is level 0, so every player can see who is connected. /list uuids adds each player's UUID, which stays the same when someone changes their name.
/transfer, added in Java 1.20.5, sends players to another server, on port 25565 unless you name a port. The server on the other end has to set accepts-transfers=true in server.properties. It is false by default, and then the player is just disconnected. /setidletimeout kicks anyone idle for the given number of minutes, and 0 turns that off. Both need level 3.