Minecraft Commands Guide 2026: Essential Cheats and Console Tricks for Java & Bedrock

Minecraft commands turn the game from an open sandbox into a fully programmable world. Whether you want to teleport across the map in an instant, fill a valley with lava, spawn a hundred creepers at once, or automate your server with command blocks, knowing your way around the command console is essential in 2026.

This guide covers every major command category for Java Edition and Bedrock Edition 1.21+, including syntax differences, a top-20 command list, a full reference table, step-by-step tutorials, and a multiplayer admin section. Bookmark it — you’ll come back to it.

How to Enable Cheats and Open the Console

Commands only work when cheats are enabled. Here’s how to turn them on per platform:

  • Singleplayer (Java): When creating a world, open the “More World Options” screen and toggle Allow Cheats: ON. On an existing world, open to LAN and enable cheats from the pause menu.
  • Singleplayer (Bedrock): Under “Game” settings when creating the world, toggle Activate Cheats. Note: this disables achievements for that world.
  • Multiplayer / Servers: Operators (OP level 2+) can run commands freely. Set enable-cheats=true in server.properties for non-OP players to use them.

To open the command console press / (Java) or tap the chat icon then type / (Bedrock). Tab-completion works on both editions — use it constantly to avoid typos.

Target Selectors: The Foundation of Every Command

Most commands accept a target. Understanding selectors saves you from typing player names by hand every time.

SelectorTargetsWorks in
@sYourself (the command sender)Both
@pNearest playerBoth
@aAll playersBoth
@eAll entities (mobs, items, arrows)Both
@rA random playerBoth
@nNearest entity of any typeBedrock only

Selectors can be filtered with arguments in square brackets. For example, @e[type=zombie,distance=..20] targets all zombies within 20 blocks. Java Edition supports more complex NBT-based filtering; Bedrock covers most common use cases.

Top 20 Must-Know Minecraft Commands

These are the commands every player, builder, and server admin should have memorised. Each includes a one-line summary and a real example.

#CommandWhat it doesExample
1/gamemodeSwitch game mode instantly/gamemode creative @s
2/tpTeleport yourself or others/tp Steve 100 64 -200
3/givePut items straight into a player’s inventory/give @s diamond 64
4/killKill entities (use with care on @a)/kill @e[type=creeper]
5/summonSpawn any mob or entity/summon wither ~ ~5 ~
6/time setChange the world time/time set day
7/weatherControl the weather/weather clear 6000
8/gameruleToggle world rules like mob spawning or fire spread/gamerule doMobSpawning false
9/effect giveApply a status effect to a player/effect give @s speed 60 2
10/enchantEnchant the item in hand/enchant @s sharpness 5
11/fillFill a region with a specific block/fill ~-5 ~ ~-5 ~5 ~10 ~5 air
12/setblockPlace a single block at exact coordinates/setblock 0 64 0 minecraft:chest
13/cloneCopy a region of blocks to another location/clone 0 60 0 10 70 10 50 60 50
14/locateFind the nearest structure or biome/locate structure minecraft:village
15/seedShow the world seed/seed
16/xp addAdd experience points or levels/xp add @s 30 levels
17/clearRemove items from a player’s inventory/clear @s dirt
18/difficultyChange world difficulty/difficulty hard
19/scoreboardCreate and manage scoreboards for minigames/scoreboard objectives add kills playerKillCount
20/executeRun commands from another entity’s position or perspective/execute as @e[type=zombie] run kill @s

Full Command Reference Table

Every commonly used Minecraft command, its purpose, an example, and platform compatibility at a glance.

CommandDescriptionExample UsageJavaBedrock
/gamemodeSet game mode/gamemode survival @a
/tp / teleportTeleport entities/tp @p 0 64 0
/giveGive items/give Steve netherite_sword 1
/killKill entities/kill @e[type=!player]
/summonSpawn entities/summon creeper ~ ~ ~
/time setSet world time/time set noon
/time addAdvance time by ticks/time add 1000
/weatherSet weather/weather thunder 3000
/difficultyChange difficulty/difficulty peaceful
/gameruleToggle game rules/gamerule keepInventory true
/effect giveApply status effect/effect give @a night_vision 120 0
/effect clearRemove all effects/effect clear @s
/enchantEnchant held item/enchant @s unbreaking 3
/xp addGrant XP/xp add @s 100 points
/fillFill region with block/fill 0 60 0 10 70 10 stone
/setblockPlace single block/setblock ~ ~-1 ~ bedrock
/cloneCopy block region/clone 0 60 0 5 65 5 20 60 20
/locate structureFind nearest structure/locate structure village
/locate biomeFind nearest biome/locate biome jungle
/seedShow world seed/seed
/clearClear inventory/clear @s sand 64
/sayBroadcast a message/say Server restarting in 5 min
/titleDisplay title on screen/title @a title {"text":"Round 1"}
/scoreboardManage scoreboards/scoreboard players add @a deaths 0
/executeRun commands conditionally/execute if entity @a[tag=winner] run say GG
/banBan a player/ban griefer Griefing spawnServer
/kickDisconnect a player/kick Steve Back in 5
/whitelistManage server whitelist/whitelist add NewPlayer
/opGrant operator status/op TrustedAdmin
/deopRemove operator status/deop FormerAdmin
/listShow online players/list
/stopStop the server/stopServer
/reloadReload datapacks/functions/reload
/publishOpen singleplayer to LAN/publish 25565
/tickingareaCreate a persistent loaded chunk area/tickingarea add 0 0 0 100 100 100 farm
/forceloadForce chunks to stay loaded/forceload add 0 0
Minecraft command block interface showing a teleport command being entered
Command blocks execute commands automatically when triggered by a redstone signal.

Player Management Commands

Player management is the bread and butter of multiplayer server administration. These commands let you control who is online, how they play, and what they can do.

Game Mode Switching

Switch modes for yourself or every player simultaneously:

  • /gamemode creative @s — you enter Creative mode
  • /gamemode survival @a — everyone reverts to Survival
  • /gamemode spectator Steve — specific player becomes a spectator

Valid modes: survival (0), creative (1), adventure (2), spectator (3).

Healing and Status

  • /effect give @s instant_health 1 10 — heal yourself immediately (amplifier 10 = max heal)
  • /effect give @a saturation 10 255 true — keep all players fed, hide particles
  • /effect clear @s — remove all effects (useful after accidental poisoning)

Experience

The /xp command accepts points (raw XP) or levels. Use levels for fast enchanting:

  • /xp add @s 30 levels — add 30 levels instantly
  • /xp set @s 0 levels — reset level to 0

For a deeper look at farming XP legitimately, see our Minecraft XP farms guide.

World and Terrain Commands

These commands reshape the world, control time and weather, and help you navigate vast maps quickly.

Time Control

Minecraft’s day cycle is 24,000 ticks (roughly 20 minutes real time):

  • /time set day — sunrise (1000 ticks)
  • /time set noon — midday (6000 ticks)
  • /time set night — nightfall (13000 ticks)
  • /time set midnight — full dark (18000 ticks)
  • /gamerule doDaylightCycle false — freeze time at current value

Weather Control

  • /weather clear 72000 — clear skies for one in-game day (72000 ticks ≈ 1 hour real time)
  • /weather rain 12000 — rain for 10 minutes
  • /weather thunder — thunderstorm (useful for channeling tridents)
  • /gamerule doWeatherCycle false — lock weather permanently

Block Placement

The /fill command is the fastest way to build or clear large areas. The syntax is:

/fill <x1> <y1> <z1> <x2> <y2> <z2> <block> [replace|destroy|hollow|outline|keep]

  • /fill ~-5 ~ ~-5 ~5 ~10 ~5 air — clear a 10×10 area around you
  • /fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 grass_block — lay a flat grass platform
  • /fill 0 0 0 100 100 100 air replace water — drain water in a region

The ~ symbol means relative to your current position. ~5 = 5 blocks in that direction from where you stand. ^ (caret) notation is relative to the direction you’re facing in Java Edition.

Finding Structures

The /locate command is invaluable for survival and exploration:

  • /locate structure minecraft:village
  • /locate structure minecraft:trial_chambers (new in 1.21)
  • /locate biome minecraft:cherry_grove

After locating, combine with /tp @s [coordinates] to jump there instantly.

Item and Inventory Commands

Giving Items

The full syntax: /give <player> <item> [count] [data]

  • /give @s diamond 64 — a full stack of diamonds
  • /give @a netherite_ingot 9 — 9 netherite ingots for every player
  • /give @s minecraft:mace 1 — the new 1.21 mace weapon

Java Edition tip: Item IDs use namespaced format (minecraft:diamond). The namespace is optional in most commands but required in some contexts. Bedrock uses the same namespace format since 1.16.

Clearing Items

  • /clear @s — empty your entire inventory
  • /clear @s dirt — remove all dirt only
  • /clear @a gravel 32 — remove up to 32 gravel from every player

Enchanting

Requires the target item to be held in the main hand:

  • /enchant @s sharpness 5
  • /enchant @s efficiency 5
  • /enchant @s mending 1

Some enchantments conflict (Silk Touch vs Fortune) — the command will reject incompatible combinations. For a full breakdown of which enchantments are worth using, see our Minecraft enchantments tier list.

Game Rule and Difficulty Control

Game rules are persistent settings that control how the world behaves. They survive world reloads.

Most Useful Game Rules

Game RuleDefaultWhat it controls
keepInventoryfalseKeep items on death (great for casual play)
doMobSpawningtrueToggle natural mob spawning
mobGriefingtruePrevent creepers and endermen from destroying blocks
doDaylightCycletrueFreeze the time of day
doWeatherCycletrueLock the current weather
doFireTicktrueStop fire from spreading
pvptrueEnable/disable player vs player damage
fallDamagetrueDisable fall damage
naturalRegenerationtrueToggle passive health regeneration
randomTickSpeed3Speed up crop growth, leaf decay (set to 20 for fast farms)
spawnRadius10Radius around spawn point where players respawn
announceAdvancementstrueHide advancement notifications in chat

Syntax: /gamerule <rule> <true|false> or a numeric value for rules like randomTickSpeed.

Difficulty

/difficulty peaceful — no hostile mobs, health regenerates
/difficulty easy — reduced mob damage
/difficulty normal — standard gameplay
/difficulty hard — increased damage, hunger can kill, villagers turn into zombies

Command Block Usage

Command blocks bring commands into the world itself — no player needs to type anything. They’re the engine behind most minigames, adventure maps, and automated farms. For a deeper dive into automation, see our Minecraft Redstone guide.

Getting a Command Block

Command blocks cannot be crafted. You must give them with a command (requires Creative mode or OP status):

/give @s minecraft:command_block

Types of Command Block

  • Impulse (orange): Runs once per redstone pulse.
  • Chain (teal): Runs when the block behind it activates. Used for sequences.
  • Repeat (purple): Runs every game tick while powered. Use sparingly — it fires 20 times per second.

Mini Tutorial: Simple Repeat Command Block Timer

  1. Place a Repeat command block and open its interface (right-click).
  2. Set it to Always Active (no redstone needed).
  3. Enter the command: /time add 1
  4. This speeds the day cycle. For a toggleable version, connect a lever to the block instead.

Step-by-Step Mini Tutorials

Teleporting Players

To exact coordinates:

/tp @s 150 70 -300

To another player:

/tp Steve Alex

To yourself (reset facing direction):

/tp @s ~ ~ ~ 0 0

The last two numbers are yaw (horizontal rotation) and pitch (vertical). 0 0 faces due south, level.

Bedrock note: The /teleport alias works on both editions. Bedrock also accepts /tp with the same syntax.

Summoning Mobs

Basic summon at your feet:

/summon zombie ~ ~ ~

Summon a named mob (Java NBT):

/summon skeleton ~ ~1 ~ {CustomName:'"Skelly"'}

Summon a charged creeper (Java):

/summon creeper ~ ~ ~ {powered:1b}

Bedrock NBT is more limited. Most basic summons work identically, but complex NBT tags (custom names, specific equipment) are Java-only or use different syntax in Bedrock.

Giving Items

One item:

/give @s elytra 1

Full stack of arrows to all players:

/give @a arrow 64

Give a potion (Java with NBT data):

/give @s minecraft:potion{Potion:"minecraft:strong_swiftness"} 1

Changing Time and Weather

Create a quick day/night toggle with two commands or a command block:

/time set 0
/gamerule doDaylightCycle false

Lock to daytime permanently. To resume the cycle:

/gamerule doDaylightCycle true

For weather:

/weather clear 999999
/gamerule doWeatherCycle false

Automating with Command Blocks

Scenario: announce when a player enters a region

  1. Place a Repeat command block at the border of your area.
  2. Set it to Always Active.
  3. Enter: /execute if entity @a[x=0,y=60,z=0,dx=20,dy=10,dz=20] run say A player has entered the farm!
  4. This checks every tick if any player is within the defined box and broadcasts the message.

Chain multiple command blocks in sequence for more complex logic — Impulse triggers the first, Chain blocks run in order behind it.

Java vs Bedrock: Key Differences

Most commands work on both editions, but there are meaningful differences when building complex systems.

FeatureJava EditionBedrock Edition
NBT data in commandsFull support ({key:value})Limited (basic tags only)
Selector @nNot supportedSupported (nearest entity)
/execute subcommandsFull: if/unless, as/at, positioned, rotated, facing, in, anchored, storeMost subcommands supported; minor syntax differences
Chunk management/forceload/tickingarea
Persistent ticking areasNot persistent across restarts by defaultNamed ticking areas survive restarts
Functions (.mcfunction)Full datapack supportBehaviour pack functions
Item data components (1.20.5+)New component syntax replaces NBT for itemsStill uses older tag approach
Resource namespaceminecraft: prefix commonminecraft: prefix also standard
/ban, /stopAvailable in singleplayer + serverServer operator only

Bottom line: If you’re building adventure maps or complex datapack-driven content, Java is significantly more powerful. For cross-platform play and simpler builds, Bedrock covers everything you need.

Multiplayer and Server Admin Commands

Running a server means knowing how to manage players, permissions, and world state. Here are the commands every server admin needs.

Player Access Control

  • /whitelist on — restrict the server to whitelisted players only
  • /whitelist add PlayerName — add someone to the list
  • /whitelist remove PlayerName — remove them
  • /whitelist list — see who’s allowed in
  • /whitelist reload — re-read whitelist.json after manual edits

Kicking and Banning

  • /kick PlayerName Reason here — temporary disconnect with a visible reason
  • /ban PlayerName Griefing spawn area — permanent ban (Java: stored in banned-players.json)
  • /ban-ip 192.168.1.100 — IP ban (prevents reconnecting with new account)
  • /pardon PlayerName — unban a player
  • /pardon-ip 192.168.1.100 — remove IP ban

Operator Management

  • /op PlayerName — grant full operator privileges
  • /deop PlayerName — revoke them
  • /list — see who is currently online

Set OP permission levels in server.properties via the op-permission-level value (1–4). Level 4 grants all permissions including bypassing spawn protection.

Troubleshooting with Commands

  • Players stuck in walls: /tp @p ~ ~5 ~ to move them up 5 blocks
  • Entity lag spike: /kill @e[type=!player] to clear all non-player entities
  • Mobs piling up: /kill @e[type=zombie] (target specific type)
  • TPS lag: /gamerule randomTickSpeed 1 to reduce game load
  • Player items stuck: /kill @e[type=item] to clear dropped items

For a full walkthrough on setting up your own Minecraft server from scratch, see our Minecraft server setup guide.

The /execute Command: Advanced Usage

/execute is the most powerful command in Minecraft. It lets you run any other command from a different position, entity, or dimension, and add conditional logic.

Core syntax (Java 1.21):
/execute [as|at|positioned|if|unless|in|run] ... run <command>

Useful examples:

  • /execute as @a at @s run tp @s ~ ~1 ~ — nudge every player up 1 block
  • /execute if block ~ ~-1 ~ minecraft:grass_block run say Standing on grass! — check block beneath the sender
  • /execute as @e[type=creeper] at @s run kill @s — instantly kill all creepers from their own position
  • /execute in minecraft:the_nether run tp @s 0 100 0 — teleport to Nether coordinates

Frequently Asked Questions

Do commands disable achievements in Minecraft?

In Bedrock Edition, enabling cheats permanently disables achievements for that world. In Java Edition, commands and cheats do not affect advancements unless you use a command that directly changes progression state.

Why isn’t my command working?

The most common reasons: cheats are not enabled, you don’t have OP permissions, there’s a typo in the command (use tab-complete), or the command syntax changed in a recent update. Check the F3 debug screen for your exact coordinates if you’re having teleport issues.

Can I use commands in Hardcore mode?

Not natively. Hardcore mode locks cheats off. The workaround on Java Edition is to open the world to LAN and enable cheats from the LAN menu, but this is a one-time toggle per session.

What’s the difference between /tp and /teleport?

They are identical commands. /teleport is the full name; /tp is the shorthand alias. Both work on Java and Bedrock.

How do I undo a /fill command?

There is no built-in undo. On Java Edition, you can use the F3+Z shortcut to undo the most recent block change if it happened in the last few seconds (requires having a backup). The safest approach is to use /fill with the keep mode, which only fills air blocks and preserves existing blocks.

Sources

  1. Minecraft Wiki. Commands. wiki.gg Community Wiki.
  2. Minecraft Wiki. Java Edition 1.21 (Tricky Trials). wiki.gg Community Wiki.
  3. Minecraft Wiki. Bedrock Edition 1.21.0. wiki.gg Community Wiki.