NEW 📢 Save up to 30% on your first month, limited time offer!

Minecraft commands for server owners

MinecraftUpdated Oct 5, 20266 min read

Minecraft commands are typed in two places, and the same command looks slightly different in each.

Where to type a command

  • In the panel Console. Open your server in the panel, click Console, click the box that says Type a command, type the command without a slash and press Enter. The server must be Online. The Console runs with full rights, so no operator status is needed. Java servers answer commands there, for example list shows who is online.
  • In the game. Open the chat, type a slash and the command. You must be an operator with a high enough level. See How to op yourself and manage permissions.

The examples below are written for the Console. In game, put a slash in front.

A command changes the running game. Some commands only last until a restart, so for a setting you want on every start, use Settings instead: it is saved and applied each time the server starts. Game rules can also be changed from Settings, then Game Rules, and they apply at once. See How to use the console and run commands.

The commands below are for Java Edition. Bedrock has its own list, shown near the end.

Players and access

The level column is the operator level needed in game. The Console needs none.

CommandWhat it doesLevel
listShows who is online0
op AlexMakes Alex an operator3
deop AlexRemoves Alex's operator rights3
whitelist add AlexLets Alex join when the whitelist is on. Also remove, list, on, off, reload3
kick AlexRemoves Alex from the server. They can rejoin3
ban AlexBans Alex until you pardon them3
pardon AlexUnbans Alex3
ban-ip 203.0.113.5Bans an address. pardon-ip unbans it3
banlistShows banned players. banlist ips shows banned addresses3
msg Alex helloSends Alex a private message0
say Server restarts in 5 minutesAnnounces a message to everyone2

The full details are in How to set up a whitelist and ban players.

Game and world

CommandWhat it doesLevel
gamemode creative AlexSets Alex's game mode to survival, creative, adventure or spectator2
defaultgamemode survivalSets the mode new players start in2
difficulty hardSets peaceful, easy, normal or hard2
time set daySets the time. Also night, noon, midnight or a number2
weather clearSets the weather to clear, rain or thunder2
tp Alex SamTeleports Alex to Sam. Coordinates also work2
give Alex diamond 16Gives Alex 16 diamonds2
gamerule keepInventory trueChanges a game rule. On the newest versions the rule is written keep_inventory. Names differ between versions, so use the list the game suggests2
setworldspawnSets the world spawn point2
worldborder set 5000Sets the size of the world border in blocks2
seedShows the world seed2
kill AlexKills Alex2
effect give Alex speed 60Gives Alex an effect for 60 seconds2
xp add Alex 10 levelsGives Alex experience2
locate structure villageFinds the closest structure of a kind2

If you are unsure about the exact words, type the command and press the tab key in game, which suggests what comes next. The Minecraft Wiki lists every option of every command.

Saving and stopping

CommandWhat it doesLevel
save-allWrites the world to disk now. Run it before you take a backup4
save-offPauses automatic saving. Run save-on afterwards to resume4
save-onResumes automatic saving4
stopSaves and stops the server4

The Stop and Restart buttons in the panel do the same job and are the usual way to stop or restart the server. See How to start, stop, restart and force-stop your server.

Run commands without typing them

Quick Tasks can send a command on a timer, for example say a reminder or save-all every hour. See How to schedule tasks and automatic backups.

Bedrock Edition

These commands are for the Bedrock server type. Pocketmine is a different program with its own commands, so type help in the Console to see what it knows. Microsoft's server guide lists these commands for the server console, typed in the Console tab without a slash:

CommandWhat it does
helpLists the commands the server knows
op AlexMakes Alex an operator
deop AlexRemoves operator rights
gameruleLists the current game rules
gamerule doDaylightCycle falseChanges a game rule. Use the exact rule name
allowlist add AlexAdds a player to the allow list. Also remove, list and reload
stopShuts the server down

Cheat commands in game also need Allow cheats on, under Settings, then Game Settings. If a command does nothing in the Console, open a ticket. See How to open a support ticket.

CREATE YOUR GAME SERVER
READY TO GET STARTED?

Save up to 30% on your new game server.
Premium performance, instant activation, and unbeatable reliability all at a better price.

OUR LATEST BLOGS