Your ultimate resource for Minecraft tools and guides.
© 2026 CraftMC. All rights reserved.
This comprehensive guide covers all essential Minecraft Java Edition commands for 2026, from basic cheats to advanced admin commands. Whether you're a beginner learning how to teleport or change gamemode, or a server admin looking for powerful commands, this guide has you covered with clear examples.
Commands in Minecraft allow you to modify your game experience, create amazing builds instantly, control server settings, and perform actions that would be impossible in regular survival gameplay. This guide will teach you everything from enabling cheats to mastering complex command syntax.
Minecraft commands are special text instructions that allow you to manipulate the game world, players, entities, and game mechanics. They start with a forward slash (/) and can be entered in the chat window or command blocks. Commands give you god-like powers to teleport anywhere, spawn any item, change the weather, control mobs, and much more.
Commands are essential for server administration, map making, testing builds, creative construction, and enhancing gameplay. They're also crucial for educational purposes, allowing teachers to demonstrate concepts or create controlled learning environments.
Use commands to instantly spawn materials, clear areas, or create complex structures. Perfect for building large projects without gathering resources.
Manage players, set rules, teleport troublemakers, and maintain server order. Essential for running a smooth multiplayer experience.
Demonstrate redstone concepts, show mob behaviors, or create controlled experiments. Great for teaching Minecraft mechanics.
Skip tedious sections, test mechanisms quickly, or practice specific techniques. Commands can save hours of gameplay.
All Minecraft commands follow a specific structure. Understanding the basic syntax will help you write commands correctly and troubleshoot issues.
/commandName [target] [arguments] [modifiers]Target selectors are special symbols that tell Minecraft which entities to affect. They're essential for advanced commands and can include conditions.
Nearest Player
Targets the closest player to the command execution point.
/tp @p ~ ~10 ~Self (Executor)
Targets the entity that executed the command.
/gamemode creative @sAll Players
Targets every player in the world/server.
/effect give @a minecraft:speed 30 2All Entities
Targets all entities (players, mobs, items, etc.).
/kill @e[type=minecraft:creeper]Random Player
Targets a random player from all available players.
/tp @r @sConditional Selection
Targets entities that match specific conditions.
/effect give @e[distance=..5] minecraft:glowing| Condition | Description | Example |
|---|---|---|
| distance=..10 | Within 10 blocks | @e[distance=..10] |
| type=zombie | Only zombies | @e[type=minecraft:zombie] |
| name=Steve | Specific player name | @a[name=Steve] |
| gamemode=creative | Players in creative mode | @a[gamemode=creative] |
| limit=5 | Maximum 5 entities | @e[type=item,limit=5] |
Before you can use commands, you need to enable cheats in your Minecraft world. Here's how to do it for different scenarios:
Server operators (OPs) can use commands by default. To give other players command access, use /op PlayerName in the console.
Command blocks take commands to the next level by allowing automation, redstone integration, and complex systems. They're essential for adventure maps, mini-games, and automated farms.
Executes once when powered by redstone
Orange command blockExecutes when the previous command block executes
Green command blockExecutes every tick while powered
Purple command blockFunctions allow you to store multiple commands in a single file and execute them all at once. They're stored in data packs and are essential for complex command systems.
data/namespace/functions/teleport.mcfunction)Execute with: /function namespace:teleport
Commands must start with /. Type /gamemode creative not gamemode creative
Minecraft commands are case-sensitive. Use minecraft:diamond_sword not minecraft:Diamond_Sword
@p targets the nearest player, @s targets yourself. Using @p when you want to affect yourself will target the wrong entity.
Enable cheats in world settings or get OP permissions on servers. Commands won't work without proper permissions.
Here are practical command examples you can copy and use in your Minecraft world:
/give @s minecraft:structure_block{posX:0,posY:0,posZ:0,name:"house",mode:"LOAD"}Note: Requires a structure file. Use creative mode to save structures first.
/summon minecraft:iron_golem ~ ~ ~ {ArmorItems:[{},{},{id:"minecraft:diamond_chestplate",Count:1b},{}],HandItems:[{id:"minecraft:diamond_sword",Count:1b},{}],Attributes:[{Name:"generic.max_health",Base:200},{Name:"generic.attack_damage",Base:15}]}Creates an iron golem with diamond armor, sword, and boosted stats.
/weather thunder 1000/summon minecraft:lightning_bolt ~ ~ ~Sets thunderstorm weather for 1000 ticks (50 seconds) and strikes lightning at your position.
/summon minecraft:armor_stand ~ ~ ~ {Invisible:1b,Marker:1b,CustomName:'{"text":"Target"}',CustomNameVisible:1b}/summon minecraft:armor_stand ~5 ~ ~ {Invisible:1b,Marker:1b,CustomName:'{"text":"Target"}',CustomNameVisible:1b}Creates invisible armor stands with visible names as targets for archery practice.
Open a world → Pause menu → Open to LAN → Enable cheats: ON → Start LAN World. For new worlds, select 'Create New World' → 'Allow Cheats: ON'.
Use /tp or /teleport followed by coordinates or player name: '/tp @s ~ ~5 ~' teleports you 5 blocks up, '/tp PlayerName' teleports to another player.
Use the /locate command: '/locate structure minecraft:stronghold' finds the nearest stronghold. Other useful structures: village, mansion, monument, fortress, bastion_remnant, end_city.
Use the /seed command to display your current world's seed number. This is useful for sharing worlds or finding specific features.
Use /gamemode followed by the mode: '/gamemode creative', '/gamemode survival', '/gamemode adventure', or '/gamemode spectator'. Shorthand: '/gamemode c', '/gamemode s', etc.
Use /give with NBT tags: '/give @s minecraft:diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:5}]}' gives a Sharpness V diamond sword.
Use /execute with in: '/execute in minecraft:the_nether run tp @s ~ 100 ~' teleports to the Nether. Replace with minecraft:the_end for the End dimension.
Use /summon with NBT data: '/summon minecraft:zombie ~ ~ ~ {ArmorItems:[{},{},{id:"minecraft:diamond_chestplate",Count:1b},{}],HandItems:[{id:"minecraft:diamond_sword",Count:1b},{}]}' spawns a zombie with diamond armor and sword.
Use /worldborder set <diameter>: '/worldborder set 1000' creates a 1000×1000 border. Use '/worldborder center ~ ~' to center it on your position.
Use /title: '/title @a title {"text":"Welcome!","color":"gold"}' shows a gold welcome message. Use 'subtitle' instead of 'title' for smaller text below.
Use /scoreboard objectives add: '/scoreboard objectives add Deaths deathCount "Player Deaths"'. Then set display: '/scoreboard objectives setdisplay sidebar Deaths'.
Use /fill command: '/fill ~ ~ ~ ~10 ~10 ~10 minecraft:stone' fills a 10x10x10 area with stone. Replace coordinates with actual positions for precise control.
Use /clone command: '/clone ~ ~ ~ ~10 ~10 ~10 ~20 ~ ~' copies a 10x10x10 area and pastes it 20 blocks away. Perfect for duplicating builds.
Use /time set command: '/time set day' for daytime, '/time set night' for nighttime, '/time set 6000' for noon, '/time set 18000' for midnight.
Use /weather command: '/weather clear' for sunny weather, '/weather rain' for rain, '/weather thunder' for thunderstorms. Add duration in seconds.
Use /effect give command: '/effect give @s minecraft:speed 30 2' gives speed II for 30 seconds. Use '/effect clear @s' to remove all effects.
Use a command block or function with loops. For simple spawning: '/summon minecraft:zombie ~ ~ ~ {Passengers:[{id:"minecraft:zombie",Passengers:[{id:"minecraft:zombie"}]}]}' for stacked mobs.
Use /give with complex NBT: '/give @s minecraft:firework_rocket{Fireworks:{Explosions:[{Type:1,Trail:1b,Colors:[I;11743532],FadeColors:[I;15435844]}]}}' creates a custom firework.
The most basic and useful commands every Minecraft player should know
/gamemode <mode>Changes your game mode to survival, creative, adventure, or spectator
/tp [target] <location> [<yRot> <xRot>]Teleports players or entities to specific coordinates, other entities, or with specific rotation
/give <player> <item> [amount]Gives items to players, with optional NBT data for custom properties
/locate <structure|biome> <name>Finds the nearest specified structure or biome
/seedDisplays the seed of the current world
Commands that modify player states and world properties
/effect <give|clear> <target> [effect] [seconds] [amplifier]Adds or removes status effects from players
/weather <type> [duration]Changes the weather to clear, rain, or thunder
/time <set|add|query> <value>Changes or queries the game time
/gamerule <rule> [value]Sets or queries game rules that control aspects of gameplay
/worldborder <set|add|center|damage|warning> [value]Controls the world border size, position, and effects
More complex commands for server admins and map makers
/summon <entity> [pos] [nbt]Summons an entity at a specific location, with optional NBT data for customization
/fill <x1> <y1> <z1> <x2> <y2> <z2> <block> [mode]Fills a region with specific blocks, with options for replacing or destroying existing blocks
/clone <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> [mode]Copies blocks from one region to another
/scoreboard <objectives|players> <...>Creates and manages scoreboards for tracking statistics and custom values
/title <target> <title|subtitle|actionbar|...> <json text>Displays title, subtitle, or action bar text to players
/bossbar <add|remove|set|get|list> ...Creates and manages boss bars at the top of the screen for displaying progress, timers, or important information
Commands for managing servers and players
/op <player>Grants operator status to a player
/whitelist <add|remove|list|on|off|reload> [player]Manages the server whitelist
/defaultgamemode <mode>Sets the default game mode for new players joining the server
/difficulty <peaceful|easy|normal|hard>Sets the game difficulty level for the entire server
/ban <name> [reason] or /pardon <name>Bans or unbans players from the server
Before you can use these commands, you need to enable cheats:
Generate complex commands with an easy-to-use interface instead of typing them manually.
Create command block contraptions and redstone systems with pre-built templates.
Edit item data, entity properties, and create custom items with complex NBT tags.
Calculate optimal nether portal locations for efficient dimension travel.