These are the commands server owners use most often. They work the same on almost every Minecraft version. For what changed in the newest release, see "Java Console Commands (26.3)".

Running commands

Players and moderation

CommandWhat it does
listShows who's online
op <player> / deop <player>Gives or removes operator status
whitelist on / whitelist offTurns the whitelist on or off
whitelist add <player> / whitelist remove <player>Adds or removes a player from the whitelist
kick <player> [reason]Removes a player from the server
ban <player> [reason] / pardon <player>Bans or unbans an account
ban-ip <player or IP> / pardon-ip <IP>Bans or unbans an IP address
banlistShows banned players (banlist ips for IPs)

Chat and messages

CommandWhat it does
say <message>Sends a message to everyone, for example a restart warning
msg <player> <message>Sends a private message (also tell or w)
title <player> title <text>Shows big text on a player's screen

Game settings

CommandWhat it does
gamemode <mode> <player>Changes a player's game mode: survival, creative, adventure or spectator
defaultgamemode <mode>Sets the game mode for new players
difficulty <level>peaceful, easy, normal or hard
gameruleLists game rules. gamerule <rule> <value> changes one
time set day / time set nightChanges the time of day
weather clearChanges the weather (clear, rain or thunder)

Players and items

CommandWhat it does
tp <player> <target player>Teleports one player to another
tp <player> <x> <y> <z>Teleports a player to coordinates
give <player> <item> [amount]Gives items, for example give Steve diamond 5
clear <player>Empties a player's inventory
xp add <player> <amount> levelsGives experience levels
effect give <player> <effect>Gives a status effect
spawnpoint <player>Sets a player's personal respawn point

World

CommandWhat it does
seedShows the world seed
setworldspawn <x> <y> <z>Sets the world spawn
worldborder set <size>Sets the world border width in blocks
locate structure <structure>Finds the nearest structure, for example minecraft:village_plains
kill @e[type=item]Removes all dropped items, which helps with lag

Server

CommandWhat it does
save-allSaves the world to disk now
save-off / save-onPauses or resumes automatic saving
stopSaves and shuts down the server cleanly
tick queryShows server tick performance (1.20.3 and newer)

Plugin servers. Paper, Purpur and Spigot add commands such as plugins, tps and version. Each plugin adds its own commands too. Check the plugin's page for its list. Avoid reload on plugin servers. Restart instead.