DGuard

Minecraft server commands: the admin's cheat sheet

In the server console you type commands without a slash; in game, with one. Each needs its operator level: kick and ban need 3, game rules and teleporting need 2, stopping and saving need 4. Below are the commands an admin uses every day, grouped by task.

The DGuard team6 min read

In short: the server console can run any command, while a player needs an operator level at least as high as the command requires. In the console you skip the / (ban Steve); in chat you type it (/ban Steve). Most commands below are vanilla and work on any server software; Paper, spark and plugin commands come at the end.

Players: access and punishments

CommandWhat it doesLevel
op <name> / deop <name>Grant or remove operator status3
whitelist add|remove <name>, whitelist on|off, whitelist listManage the whitelist3
kick <name> [reason]Kick a player off the server3
ban <name> [reason] / pardon <name>Ban and unban by name3
ban-ip <name|IP> / pardon-ip <IP>Ban and unban an address3
banlist [players|ips]Show the ban lists3
setidletimeout <minutes>Kick idle players after N minutes3
transfer <host> [port] [players]Send players to another server (only if it has accepts-transfers=true)3
Levels from the Java Edition command list on the Minecraft Wiki

Vanilla bans live in this server's banned-players.json and banned-ips.json. On a network a ban on one server doesn't apply to the others — that's what punishment plugins with a shared database are for; see ban plugins.

The game and the world

CommandWhat it doesLevel
gamemode <mode> [player]Game mode: survival, creative, adventure, spectator2
gamerule <rule> [value]A game rule; without a value it shows the current one. The full list: game rules2
difficulty <difficulty>Difficulty: peaceful, easy, normal, hard2
time set day|night|<ticks>Time of day2
weather clear|rain|thunderWeather2
worldborder set <diameter>The world border — more in the world border2
setworldspawn / spawnpoint <player>The world spawn and a player's own spawn point2
tp <who> <where>Teleport a player to a player or to coordinates2
give <player> <item> [count] / clear <player>Give items and clear an inventory2
effect give <player> <effect>Apply an effect2
kill <target> / summon <entity>Kill or summon entities2
locate structure|biome <id>Find the nearest structure or biome2
seedShow the world seed (level 2 in multiplayer)2
tick rate|freeze|stepControl the tick rate — for debugging3

Targets are set with selectors: @p is the nearest player, @r a random one, @a every player, @e every entity, @s whoever runs the command, @n the nearest entity (since 1.21). Arguments narrow it down: @e[type=minecraft:item,distance=..32] is every dropped item within 32 blocks, @a[gamemode=creative] everyone in creative.

The server: saving, stopping, messages

CommandWhat it doesLevel
listWho's online0
say <text>A message to everyone from the server2
msg <player> <text>A private message (aliases tell, w)0
save-all [flush]Save the worlds; with flush immediately, freezing the server for a moment4
save-off / save-onTurn auto-saving off and on — needed for a backup without stopping4
stopSave everything and shut the server down cleanly4
versionThe server's game version2
help [command]Help on commands0

How to back up with save-off and save-all flush without stopping the server: server backups. Only shut the server down with stop: closing the window or killing the process can leave the world unsaved.

Paper and spark commands

CommandWhat it does
plugins (pl)The plugin list: green works, red failed to load
version [plugin]The Paper or plugin version
tpsTPS over 1, 5 and 15 minutes
msptTick time in milliseconds over 5, 10 and 60 seconds
spark profiler start --timeout 600A 10-minute lag profile with a link to the report
spark healthTPS, CPU, memory and disk
paper entity listWhich entities are ticking and where most of them are
paper mobcapsMob caps and how many chunks take part in spawning
From Paper's command reference; Paper marks reload and timings deprecated

Don't use /reload: Paper marks it deprecated and recommends restarting instead. A reload leaves plugins in an unpredictable state. Finding the cause of lag with mspt and spark: why is my server lagging.

DGuard anticheat commands

Plugins bring their own commands and permissions. DGuard — the best anticheat for a modern Minecraft server — has these, available with the dguard.admin permission:

CommandWhat it does
/dguard licensePlan, player limit, license state, the last signal to the site and the PacketEvents version
/dguard updateCheck for and download a new version — it installs on restart
/dguard reloadReload the config
/dguard perfHow long the checks take

FAQ

How do I type a command in the Minecraft server console?

Just enter it without a slash: op Steve, whitelist add Alex, stop. The console runs any command with full rights.

Which OP level do I need to ban?

3: ban, ban-ip, pardon, kick, op and whitelist need level 3. stop and save-all need 4.

How do I find the server's seed?

With seed in the console, or in game with operator level 2 or higher.

Can I reload plugins with /reload?

Better not: Paper marks /reload deprecated and recommends a restart. Plugins can misbehave after a reload.

How do I check the server's TPS?

With tps (over 1, 5 and 15 minutes) or mspt (tick time) on Paper; spark health gives a detailed report.

Sources

All sections

Run the best anticheat for modern Minecraft

DGuard catches all 47 kinds of cheats in our comparison — the closest rival, Intave, has 27. Full protection on every plan, free up to 30 players online.