Minecraft Commands

Minecraft Commands: Full List With Examples (Java and Bedrock)

Want daytime forever, a stack of diamonds, or a quick trip across the map? Minecraft commands let you control almost everything in your world by typing a short line in chat. This guide shows you how to turn on cheats, how command syntax works, and gives you a full list of the most useful Minecraft commands with ready-to-copy examples for Bedrock (Minecraft PE) and Java Edition.

The commands work in the latest Minecraft APK, Bedrock Edition and Java Edition. Small differences are marked.

Minecraft Commands

What Are Minecraft Commands?

Minecraft commands are text instructions that start with a slash (/). Type them in the chat box and the game carries them out instantly: change the time, give items, teleport, spawn mobs, change rules and much more. Builders use them to save time, map makers use them to create adventures, and server owners use them to manage players.

How to Enable Cheats (Commands)

Bedrock and Minecraft PE

  1. Create a new world or tap the pencil icon to edit an existing one.
  2. Open the Cheats section and turn on Activate Cheats.
  3. Confirm the warning. Achievements are turned off for that world.
  4. In the game, tap the chat button and type a command starting with /.

Java Edition

  1. When creating a world, set Allow Commands to ON.
  2. For an existing world: press Esc, choose Open to LAN, turn on Allow Commands and start the LAN world. This lasts until you leave.
  3. Press T or / to open chat and type the command.

Tip: back up your world before experimenting. Our guide on how to back up Minecraft worlds shows how.

Command Basics: Syntax and Target Selectors

All Minecraft commands follow a similar pattern. Most commands follow the pattern /command target value. The target tells the game who the command affects:

SelectorTargets
@sYourself (the player running the command)
@pThe nearest player
@aAll players
@rA random player
@eAll entities (mobs, items and players)
PlayerNameOne specific player

Coordinates are written as X Y Z. A tilde (~) means “relative to where I am”, so ~ ~10 ~ means 10 blocks above you. The Minecraft Wiki commands page lists every option. Press Tab on Java, or look at the suggestions above the chat on Bedrock, to auto-complete commands.

Most Useful Minecraft Commands

CommandWhat It DoesExample
/gamemodeChange game mode/gamemode creative
/time setChange the time of day/time set day
/weatherChange the weather/weather clear
/giveGive items/give @s diamond 64
/tpTeleport/tp @s 100 70 -200
/summonSpawn a mob or entity/summon wolf
/killRemove entities/kill @e[type=zombie]
/clearEmpty an inventory/clear @s
/difficultyChange difficulty/difficulty peaceful
/locateFind structures or biomes/locate structure village
/spawnpointSet a player’s respawn point/spawnpoint @s
/setworldspawnSet the world spawn/setworldspawn
/fillFill an area with blocks/fill ~ ~ ~ ~10 ~5 ~10 stone
/cloneCopy an area/clone 0 64 0 10 70 10 20 64 20
/saySend a message to everyone/say Hello world

Game Mode, Time and Weather Commands

  • These are the Minecraft commands players use most every day.
  • /gamemode survival, /gamemode creative, /gamemode adventure and /gamemode spectator switch modes.
  • /time set day, night, noon or midnight change the time. Bedrock also accepts sunrise and sunset.
  • /time add 1000 moves time forward by 1,000 ticks (a full day is 24,000 ticks).
  • /weather clear, /weather rain or /weather thunder change the weather. Add a number of seconds to set how long it lasts.

Item and Inventory Commands

  • /give @s netherite_sword 1 gives you an item. Use item IDs with underscores.
  • /enchant @s sharpness 5 enchants the item in your hand (up to the normal maximum level).
  • /clear @s dirt removes only dirt from your inventory.
  • /give @s command_block gives you a command block (Creative and cheats only).

Teleport and Location Commands

  • /tp @s 0 100 0 teleports you to exact coordinates.
  • /tp @s FriendName teleports you to another player.
  • /locate structure village or /locate structure ancient_city shows the coordinates of the nearest structure. On Java, villages have biome names like village_plains.
  • /locate biome cherry_grove finds the nearest biome.

Want permanent fast travel without cheats? See how to make portals in Minecraft.

Mob and Effect Commands

  • /summon zombie spawns a mob at your position. Learn about each variant in our Minecraft zombies guide.
  • /kill @e[type=creeper] removes every creeper in loaded areas.
  • Java: /effect give @s night_vision 300 0 gives Night Vision for 300 seconds.
  • Bedrock: /effect @s night_vision 300 0 does the same.
  • /effect clear @s (Java) or /effect @s clear (Bedrock) removes all effects.

World Rule Commands (Gamerules)

Gamerule Minecraft commands change how your world behaves. These are the Bedrock names; Java Edition renamed many gamerules in recent versions, so type /gamerule and use auto-complete to see the exact names in your version.

Command (Bedrock)Effect
/gamerule keepinventory trueKeep your items when you die
/gamerule dodaylightcycle falseStop the day and night cycle
/gamerule doweathercycle falseStop weather changes
/gamerule mobgriefing falseStop creepers and other mobs from breaking blocks
/gamerule showcoordinates trueShow your coordinates on screen
/gamerule domobspawning falseStop mobs from spawning naturally

Building Commands

/fill and /clone are huge time savers for big builds. For example, /fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 oak_planks creates an 11 by 11 wooden floor under you. Combine them with our guide on how to build a house in Minecraft to finish projects faster. Most game versions limit how many blocks one command can change, so split very large areas into parts.

Advanced: /execute and Command Blocks

The most powerful Minecraft commands are /execute and command blocks. /execute runs another command as or at a different entity, or only when a condition is true. Example (Java and Bedrock): /execute as @a at @s run summon lightning_bolt strikes lightning on every player. Command blocks run commands automatically with Redstone power, which is how map makers create minigames and adventure maps.

Java vs Bedrock Command Differences

TaskJava EditionBedrock / PE
Give an effect/effect give @s speed 60 1/effect @s speed 60 1
Add experience levels/xp add @s 10 levels/xp 10L @s
Show world seed/seedSeed is shown in world settings
Show coordinatesPress F3/gamerule showcoordinates true
AchievementsNot affectedDisabled when cheats are on

Planning to try new worlds? See our guide to Minecraft seeds.

Common Command Errors and Fixes

ErrorFix
“You do not have permission”Turn on cheats or ask the server owner for operator rights
“Unknown command”Check spelling and that the command exists in your edition
Item not foundUse the item ID with underscores, like golden_apple
Nothing happensCheck the target selector and coordinates
Too many blocksSplit /fill or /clone into smaller areas

Frequently Asked Questions

Do Minecraft commands work on mobile?

Yes. Turn on Activate Cheats in your world settings, tap the chat button and type the command.

Do commands disable achievements?

On Bedrock and Minecraft PE, yes: turning on cheats disables achievements for that world. Java Edition advancements are not affected the same way.

What is the command to keep inventory?

On Bedrock type /gamerule keepinventory true. On Java, type /gamerule and use auto-complete to find the keep inventory rule name for your version.

How do I find a village with commands?

Use /locate structure village on Bedrock, or /locate structure with a village type such as village_plains on Java.

Can I use commands on servers?

Only if the server gives you operator permissions. Most public servers do not allow players to use cheat commands.

Final Thoughts

Minecraft commands turn you into the boss of your world. Turn on cheats, learn the target selectors, and start with the basics like /gamemode, /time, /weather, /give and /tp. Then move on to /locate, /fill, gamerules and /execute as you get comfortable. Keep a backup, remember that Bedrock disables achievements with cheats, and use auto-complete when you are unsure of a name. New to the game? Read how to play Minecraft first.

Similar Posts