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.

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,@sand@emean - 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 @eand a clean server shutdown
Table of contents
- Basics: how commands work
- Target selectors
- Permission levels
- Commands by purpose
- Game mode, time, weather and difficulty
- Players: teleport, items and effects
- Editing the world
- Chat and communication
- Server administration
- The most important commands in practice
- Troubleshooting
- Frequently asked questions
- Related articles
- Summary
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 ~
Target selectors
Selectors save you from typing individual player names and let one command hit several targets at once.
| Selector | Selects |
|---|---|
@p | the nearest player |
@a | all players |
@r | a random player |
@s | whoever runs the command |
@e | all 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.
/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.
| Level | Allows (examples) |
|---|---|
| 0 | basic commands such as /help, /me, /tell |
| 1 | gameplay commands such as /give, /kill |
| 2 | world commands such as /setblock, /clone, /time – and command blocks |
| 3 | admin commands such as /ban, /kick, /op, /deop |
| 4 | full 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.
| Command | Syntax | Effect |
|---|---|---|
| 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 | /seed | show the world seed |
Examples:
gamemode:/gamemode creative @atime:/time set dayweather:/weather cleardifficulty:/difficulty hardgamerule:/gamerule keep_inventory trueseed:/seed
In practice:
/time set day
/weather clear
/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.
| Command | Syntax | Effect |
|---|---|---|
| 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> 1kill:/kill @seffect:/effect clear @senchant:/enchant @s <enchantment> 1experience:/experience add @s 5 levelsspawnpoint:/spawnpoint @ssetworldspawn:/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.
| Command | Syntax | Effect |
|---|---|---|
| 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 20summon:/summon <entity> 0 64 0locate:/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.
| Command | Syntax | Effect |
|---|---|---|
| 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 shortlytell:/tell @p Hellome:/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.
| Command | Syntax | Effect |
|---|---|---|
| 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 | /list | show connected players |
| save-all | /save-all | save the world immediately |
| stop | /stop | shut the server down cleanly |
Examples:
whitelist:/whitelist onop:/op Alexdeop:/deop Alexkick:/kick Alex Restartban:/ban Alex Rule violationpardon:/pardon Alexban-ip:/ban-ip 192.0.2.1pardon-ip:/pardon-ip 192.0.2.1banlist:/banlist playerslist:/listsave-all:/save-allstop:/stop
In chat:
/save-all
/stop
In the server console you type the same commands without the /:
save-all
stop
/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
stop is the right way.Troubleshooting
| Problem | Likely cause and fix |
|---|---|
| "Unknown command" | Check for typos, an outdated name or missing permissions. |
| The command shows red in chat or does nothing | Cheats may not be enabled in single-player, or you lack operator rights on the server. |
/gamerule does not know the rule | Since 26.2, rule names use snake_case. An old camelCase spelling can fail. See Minecraft game rules. |
/fill or /clone aborts over too many blocks | The 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 slash | Console 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.
Related articles
- How to create a Minecraft server – set up a server and become an operator
- Minecraft game rules – every rule for
/gamerule - Minecraft server.properties explained –
op-permission-leveland other server settings - The best Minecraft seeds – worlds to match the seed
/seedreports
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.