Minecraft commands are the management tool for your world and your server. They let you switch game modes, teleport players, hand out items, change weather and time, or run admin tasks such as whitelist, bans and shutting the server down.

In chat, commands start with /; in the server console the slash is left out. If you want to set up a server or hand out operator rights first, the basics are in how to create a Minecraft server.

Minecraft commands – a player on an obsidian platform lined with command blocks sends golden arcs of light over a world where the sun shines on one side and a thunderstorm rages on the other

last checked against the official Java Edition documentation, as of August 2026 (version 26.2)

What you will learn

  • how Minecraft commands are entered in chat and in the server console
  • what the selectors @p, @a, @r, @s and @e mean
  • which permission levels operators have on a server
  • which commands you need for players, the world and server administration
  • what to watch out for with /gamerule, /kill @e and a clean server shutdown

Table of contents

Basics: how commands work

In Minecraft chat, every command starts with a slash:

/gamemode creative

In the server console you leave the slash out:

gamemode creative

This article uses the following notation:

  • <required> marks a required argument.
  • [optional] marks an optional one.

Most commands need cheats enabled in single-player. On a server you need operator rights for many of them. How to make a player an operator with op in the console is covered in how to create a Minecraft server.

Minecraft also supports relative coordinates with ~. So ~ ~1 ~ means one level above whoever runs the command.

/tp @s ~ ~1 ~
Info
Java Edition has used the year.drop.hotfix versioning scheme since December 2025. This article refers to Java Edition 26.2, as of August 2026.

Target selectors

Selectors save you from typing individual player names and let one command hit several targets at once.

SelectorSelects
@pthe nearest player
@aall players
@ra random player
@swhoever runs the command
@eall entities (players, mobs, objects)

Example – put every player into creative mode:

/gamemode creative @a

Example – apply a command to yourself:

/kill @s

You can always use a player name instead of a selector.

Caution
/kill @e hits every entity – not just mobs, but players, armour stands, item frames and villagers too. To clear dropped items only, use the filtered selector /kill @e[type=minecraft:item].

Permission levels

On servers, the operator permission level decides which commands an operator may run.

LevelAllows (examples)
0basic commands such as /help, /me, /tell
1gameplay commands such as /give, /kill
2world commands such as /setblock, /clone, /time – and command blocks
3admin commands such as /ban, /kick, /op, /deop
4full control including /stop and /save-all

The default level for new operators is set with op-permission-level in server.properties. The default value is 4. More on that in Minecraft server.properties explained.

Commands by purpose

The tables below group the most important Minecraft commands by what you actually use them for. The syntax uses <required> for mandatory arguments and [optional] for optional ones.

Game mode, time, weather and difficulty

These commands change fundamental properties of your world or a player: game mode, time of day, weather, difficulty and game rules.

CommandSyntaxEffect
gamemode/gamemode <survival/creative/adventure/spectator> [player]set the game mode
time/time set <day/noon/night/midnight/value>set the time of day (0–24000)
weather/weather <clear/rain/thunder> [duration]set the weather
difficulty/difficulty <peaceful/easy/normal/hard>set the difficulty
gamerule/gamerule <rule> [value]query or set a game rule
seed/seedshow the world seed

Examples:

  • gamemode: /gamemode creative @a
  • time: /time set day
  • weather: /weather clear
  • difficulty: /difficulty hard
  • gamerule: /gamerule keep_inventory true
  • seed: /seed

In practice:

/time set day
/weather clear
Important
Since Java Edition 26.2, /gamerule uses snake_case rule names. To keep your inventory, the command is /gamerule keep_inventory true. Older guides using camelCase names can therefore fail. Every rule is listed in Minecraft game rules.

Players: teleport, items and effects

These commands change position, inventory, experience, effects or spawn points of players and other targets.

CommandSyntaxEffect
tp / teleport/tp <target> or /tp <player> <x> <y> <z>teleport
give/give <player> <item> [count]give items
kill/kill [targets]kill entities
effect/effect give <targets> <effect> [seconds] [level] or /effect clear [targets]grant or clear status effects
enchant/enchant <targets> <enchantment> [level]enchant the held item
experience / xp/experience add <targets> <amount> [levels/points]grant experience (also set/query)
spawnpoint/spawnpoint [player] [x y z]set a personal spawn point
setworldspawn/setworldspawn [x y z]set the world spawn

Examples:

  • tp: /tp @s ~ ~1 ~
  • give: /give @s <item> 1
  • kill: /kill @s
  • effect: /effect clear @s
  • enchant: /enchant @s <enchantment> 1
  • experience: /experience add @s 5 levels
  • spawnpoint: /spawnpoint @s
  • setworldspawn: /setworldspawn

In practice:

/tp @s ~ ~1 ~
/experience add @s 5 levels

Editing the world

World commands set, fill or copy blocks, spawn entities and locate structures or biomes.

CommandSyntaxEffect
setblock/setblock <x y z> <block>set a single block
fill/fill <x1 y1 z1> <x2 y2 z2> <block>fill an area
clone/clone <x1 y1 z1> <x2 y2 z2> <target x y z>copy an area
summon/summon <entity> [x y z]spawn an entity
locate/locate <structure/biome/poi> <name>find the nearest structure or biome

Examples:

  • setblock: /setblock 0 64 0 <block>
  • fill: /fill 0 64 0 10 70 10 <block>
  • clone: /clone 0 64 0 10 70 10 20 64 20
  • summon: /summon <entity> 0 64 0
  • locate: /locate biome <name>

In practice:

/fill 0 64 0 10 70 10 <block>

/fill and /clone are limited by the game rule max_block_modifications. The default is 32768 blocks.

Chat and communication

For simple communication, Minecraft offers public, private and action-style messages.

CommandSyntaxEffect
say/say <message>message to everyone
tell / msg / w/tell <targets> <message>private message
me/me <action>action message in third person

Examples:

  • say: /say Server restarting shortly
  • tell: /tell @p Hello
  • me: /me is building at spawn

In practice:

/say Server restarting shortly

Server administration

These commands matter most to server operators: whitelist, operators, kicks, bans, saving and a clean shutdown.

CommandSyntaxEffect
whitelist/whitelist <on/off/add/remove/list/reload>manage the whitelist
op / deop/op <player> or /deop <player>grant or revoke operator rights
kick/kick <player> [reason]remove a player from the server
ban / pardon/ban <player> [reason] or /pardon <player>ban or unban
ban-ip / pardon-ip/ban-ip <ip> or /pardon-ip <ip>ban or unban an IP
banlist/banlist <players/ips>show the ban list
list/listshow connected players
save-all/save-allsave the world immediately
stop/stopshut the server down cleanly

Examples:

  • whitelist: /whitelist on
  • op: /op Alex
  • deop: /deop Alex
  • kick: /kick Alex Restart
  • ban: /ban Alex Rule violation
  • pardon: /pardon Alex
  • ban-ip: /ban-ip 192.0.2.1
  • pardon-ip: /pardon-ip 192.0.2.1
  • banlist: /banlist players
  • list: /list
  • save-all: /save-all
  • stop: /stop

In chat:

/save-all
/stop

In the server console you type the same commands without the /:

save-all
stop
Important
Shut down with /stop – or stop in the console – instead of closing the server window. The command saves the world cleanly; killing the process risks data loss.

For advanced use there are further commands such as /execute, /scoreboard and /function. They are not covered in detail in this overview.

The most important commands in practice

Teleporting players

For a teleport you can use a player, a selector or coordinates. Relative coordinates with ~ are based on the position of whoever runs the command.

One level up:

/tp @s ~ ~1 ~

Put every player into creative mode:

/gamemode creative @a

Giving items and experience

Items go out with /give, experience with /experience.

/give @s <item> 1
/experience add @s 5 levels

For several players, use @a instead of @s.

Setting time and weather

/time and /weather adjust the environment directly.

/time set day
/weather clear

The time of day accepts the presets day, noon, night and midnight, or a value from 0 to 24000.

Setting game rules (gamerule)

Since Java Edition 26.2, /gamerule uses snake_case instead of the former camelCase rule names.

Keep your inventory after dying:

/gamerule keep_inventory true

If you follow an older guide with a camelCase name and Minecraft does not recognise the rule, check the current spelling. A full overview is in Minecraft game rules.

Shutting the server down cleanly

Save the world and stop the server properly:

/save-all
/stop

In the console:

save-all
stop
Caution
Force-closing the server window risks data loss. For a controlled shutdown, stop is the right way.

Troubleshooting

ProblemLikely cause and fix
"Unknown command"Check for typos, an outdated name or missing permissions.
The command shows red in chat or does nothingCheats may not be enabled in single-player, or you lack operator rights on the server.
/gamerule does not know the ruleSince 26.2, rule names use snake_case. An old camelCase spelling can fail. See Minecraft game rules.
/fill or /clone aborts over too many blocksThe game rule max_block_modifications limits changes to 32768 blocks by default.
/kill @e removed far too much@e selects every entity. For dropped items, use /kill @e[type=minecraft:item].
The console ignores /stop with a slashConsole commands are entered without /. Use stop.

Frequently asked questions

How do I become an operator on my Minecraft server?

You become an operator by running op <player> in the server console. Further steps for server setup and operator rights are in how to create a Minecraft server.

How do I teleport to another player?

Use /tp <target> to teleport yourself to another target. You can also move a player to coordinates with /tp <player> <x> <y> <z>.

Why is my command not working?

Usually it is a typo, an outdated name or missing permissions. In single-player most commands need cheats enabled; on a server you need the matching operator permission.

What do @p, @a, @r, @s and @e mean?

@p selects the nearest player, @a all players, @r a random player, @s whoever runs the command, and @e every entity.

How do I change a player's game mode?

Change it with /gamemode <survival/creative/adventure/spectator> [player]. For everyone at once, use /gamemode creative @a.

How do I stop a Minecraft server properly?

Stop it cleanly with /stop in chat or stop in the server console. Beforehand you can force an immediate save with /save-all or save-all.

Do these commands work in Bedrock Edition too?

This article covers the Java Edition. In Bedrock Edition, the syntax and the range of commands differ in places.

Summary

This Minecraft command list puts the essentials for game mode, teleport, items, effects, world editing and server administration in one place. What matters most on current Java servers is the snake_case spelling for /gamerule, using selectors correctly, and shutting down cleanly with stop.

If you want to use these commands on a server of your own, start by creating a Minecraft server or simply rent a Minecraft server.