Useful Minecraft commands with examples
Published on 3 October 2026
You run a Minecraft command by typing it in chat with a slash in front, like /time set day to make it daytime straight away. In your own world, commands have to be allowed, and on a server you need to be an operator; in the server console you type the same thing without the slash.
Below are the commands people actually use, with examples for Java and Bedrock. Checked against Java 26.3 and Bedrock 26.52.
How do you use commands in Minecraft?
- Open chat: on PC press T, or / to start with the slash already typed. Tab completes names and commands.
- Java: switch on Allow Commands when you create a world. Forgot? Since 26.2 you can switch it on later through Esc and World Options.
- Bedrock: switch on Activate Cheats in your world settings. Achievements are then off for good in that world.
- Server: you need operator rights. The server console can run everything, without the slash.
Instead of a player name you can use a target selector: @s is you, @p the nearest player, @a all players and @e every entity, mobs and dropped items included.
Which commands change time, weather and game mode?
| What you want | Command |
|---|---|
| Make it day | /time set day |
| Stop time | Java: /gamerule advance_Bedrock: /gamerule dodaylight |
| Clear weather | /weather clear |
| Creative mode | /gamemode creative |
| No monsters | /difficulty peaceful |
| Go to coordinates | /tp @s 100 64 -200 |
| Go to a friend | /tp Alex |
| Find a village | Java: /locate structure #villageBedrock: /locate structure village |
| Skip the night with one sleeper | Java: /gamerule players_Bedrock: /gamerule players |
/time set also takes night, noon or midnight. The game modes are survival, creative, adventure and spectator; add a player name to switch someone else. In Java you see your coordinates with F3. In Bedrock, switch on Show Coordinates in your world settings.
Which commands give items, effects and XP?
/give @s minecraft:cakegives you a cake. In Bedrock it’s/give @s cake. Rather bake one? See how to make a cake in Minecraft./effect give @s minecraft:night_vision infinitegives you night vision that never ends. In Bedrock:/effect @s night_vision infinite./effect clear @s(Bedrock:/effect @s clear) removes all effects./enchant @s minecraft:sharpness 5enchants whatever you’re holding, if it fits. The full list is in the best Minecraft enchantments./xp add @s 30 levelsgives you thirty levels. In Bedrock:/xp 30L @s./kill @e[type=minecraft:item]clears dropped items lying around (Bedrock:/kill @e[type=item]). Handy when the server starts to lag.
Which commands manage players on a server?
| Command | What it does |
|---|---|
op Alex | Makes Alex an operator. deop Alex takes it away again. |
whitelist add Alex | Adds Alex to the whitelist. In Bedrock it’s allowlist add Alex. |
whitelist on | Only players on the list can join. New Java servers have it on by default since 26.3. |
kick Alex | Removes Alex from the server. He can rejoin right away. |
ban Alex | Bans Alex. pardon Alex lets him back in (Java). |
list | Shows who is online. |
say Cake at spawn at eight! | Sends a message to everyone. |
save-all | Saves the world right now (Java). Useful before a backup. |
Step by step: use your server console and turn on the whitelist and add operators. Kids on your server? Then the whitelist is the most important command of all; also read a Minecraft server for your kids. And if nobody should lose their stuff, turn on keep inventory.
Which commands help with building?
/fill 0 64 0 10 70 10 minecraft:stonefills the space between two points with stone. In Java that’s up to 32,768 blocks at a time./clonecopies part of the world to another spot, and/setblockplaces a single block./setworldspawnturns the spot you’re standing on into the world spawn. More in how to set the spawn on your Minecraft server.- Building big? WorldEdit is faster than single commands. Read how to use WorldEdit.
Want to be in charge of the commands? On your own Minecraft server you’re the operator and you set the rules, even when your friends play without you. See the Minecraft plans.