Minecraft Java Edition Commands List 2026: Complete Guide for Beginners and Advanced Players

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.

What Are Minecraft Commands?

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.

When Should You Use Commands?

Creative Building

Use commands to instantly spawn materials, clear areas, or create complex structures. Perfect for building large projects without gathering resources.

Server Administration

Manage players, set rules, teleport troublemakers, and maintain server order. Essential for running a smooth multiplayer experience.

Educational Purposes

Demonstrate redstone concepts, show mob behaviors, or create controlled experiments. Great for teaching Minecraft mechanics.

Speedrunning & Testing

Skip tedious sections, test mechanisms quickly, or practice specific techniques. Commands can save hours of gameplay.

Command Syntax Basics

All Minecraft commands follow a specific structure. Understanding the basic syntax will help you write commands correctly and troubleshoot issues.

Basic Command Structure:

/commandName [target] [arguments] [modifiers]
  • / - Required prefix for all commands
  • commandName - The specific command (tp, give, gamemode, etc.)
  • [target] - Who/what the command affects (@s, @p, @a, player names)
  • [arguments] - Required parameters (coordinates, item names, etc.)
  • [modifiers] - Optional parameters (NBT data, conditions, etc.)

Target Selectors Explained

Target selectors are special symbols that tell Minecraft which entities to affect. They're essential for advanced commands and can include conditions.

@p

Nearest Player

Targets the closest player to the command execution point.

/tp @p ~ ~10 ~

@s

Self (Executor)

Targets the entity that executed the command.

/gamemode creative @s

@a

All Players

Targets every player in the world/server.

/effect give @a minecraft:speed 30 2

@e

All Entities

Targets all entities (players, mobs, items, etc.).

/kill @e[type=minecraft:creeper]

@r

Random Player

Targets a random player from all available players.

/tp @r @s

@e[conditions]

Conditional Selection

Targets entities that match specific conditions.

/effect give @e[distance=..5] minecraft:glowing

Common Target Selector Conditions

ConditionDescriptionExample
distance=..10Within 10 blocks@e[distance=..10]
type=zombieOnly zombies@e[type=minecraft:zombie]
name=SteveSpecific player name@a[name=Steve]
gamemode=creativePlayers in creative mode@a[gamemode=creative]
limit=5Maximum 5 entities@e[type=item,limit=5]

Enabling Commands in Your World

Before you can use commands, you need to enable cheats in your Minecraft world. Here's how to do it for different scenarios:

For Existing Worlds:

  1. Press Esc to open the pause menu
  2. Click "Open to LAN"
  3. Set "Allow Cheats" to "ON"
  4. Click "Start LAN World"
  5. Commands are now enabled for this session

For New Worlds:

  1. Click "Singleplayer" → "Create New World"
  2. Click "More World Options"
  3. Set "Allow Cheats" to "ON"
  4. Create your world
  5. Commands are permanently enabled

For Servers:

Server operators (OPs) can use commands by default. To give other players command access, use /op PlayerName in the console.

Command Blocks and Automation

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.

Impulse

Executes once when powered by redstone

Orange command block

Chain

Executes when the previous command block executes

Green command block

Repeat

Executes every tick while powered

Purple command block

Functions and Data Packs

Functions 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.

Creating a Simple Function:

  1. Create a data pack folder structure: data/namespace/functions/
  2. Create a .mcfunction file (e.g., teleport.mcfunction)
  3. Add commands to the file, one per line:
tellraw @s "Teleporting to spawn..."
tp @s 0 100 0
effect give @s minecraft:slow_falling 30 1
playsound minecraft:entity.enderman.teleport master @s

Execute with: /function namespace:teleport

Common Command Mistakes and How to Fix Them

Missing Forward Slash

Commands must start with /. Type /gamemode creative not gamemode creative

Incorrect Capitalization

Minecraft commands are case-sensitive. Use minecraft:diamond_sword not minecraft:Diamond_Sword

Wrong Target Selector

@p targets the nearest player, @s targets yourself. Using @p when you want to affect yourself will target the wrong entity.

Missing Cheats Permission

Enable cheats in world settings or get OP permissions on servers. Commands won't work without proper permissions.

Real-World Command Examples

Here are practical command examples you can copy and use in your Minecraft world:

🏠 Spawn a Complete House

/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.

⚔️ Spawn a Fully Armed Iron Golem

/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.

🌧️ Create a Storm with Lightning

/weather thunder 1000/summon minecraft:lightning_bolt ~ ~ ~

Sets thunderstorm weather for 1000 ticks (50 seconds) and strikes lightning at your position.

🎯 Create a Target Practice Range

/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.

Quick Answers: Essential Minecraft Commands

How do I enable commands/cheats in Minecraft?

Open a world → Pause menu → Open to LAN → Enable cheats: ON → Start LAN World. For new worlds, select 'Create New World' → 'Allow Cheats: ON'.

How do I teleport in Minecraft?

Use /tp or /teleport followed by coordinates or player name: '/tp @s ~ ~5 ~' teleports you 5 blocks up, '/tp PlayerName' teleports to another player.

How do I find structures like strongholds in Minecraft?

Use the /locate command: '/locate structure minecraft:stronghold' finds the nearest stronghold. Other useful structures: village, mansion, monument, fortress, bastion_remnant, end_city.

How do I get my world seed in Minecraft?

Use the /seed command to display your current world's seed number. This is useful for sharing worlds or finding specific features.

How do I change gamemode in Minecraft?

Use /gamemode followed by the mode: '/gamemode creative', '/gamemode survival', '/gamemode adventure', or '/gamemode spectator'. Shorthand: '/gamemode c', '/gamemode s', etc.

How do I give myself custom items with enchantments in Minecraft?

Use /give with NBT tags: '/give @s minecraft:diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:5}]}' gives a Sharpness V diamond sword.

How do I teleport between dimensions in Minecraft?

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.

How do I spawn custom mobs with armor and weapons?

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.

How do I create a world border in Minecraft?

Use /worldborder set <diameter>: '/worldborder set 1000' creates a 1000×1000 border. Use '/worldborder center ~ ~' to center it on your position.

How do I display text on screen to all players?

Use /title: '/title @a title {"text":"Welcome!","color":"gold"}' shows a gold welcome message. Use 'subtitle' instead of 'title' for smaller text below.

How do I create a scoreboard objective in Minecraft?

Use /scoreboard objectives add: '/scoreboard objectives add Deaths deathCount "Player Deaths"'. Then set display: '/scoreboard objectives setdisplay sidebar Deaths'.

How do I fill an area with blocks instantly?

Use /fill command: '/fill ~ ~ ~ ~10 ~10 ~10 minecraft:stone' fills a 10x10x10 area with stone. Replace coordinates with actual positions for precise control.

How do I clone structures in Minecraft?

Use /clone command: '/clone ~ ~ ~ ~10 ~10 ~10 ~20 ~ ~' copies a 10x10x10 area and pastes it 20 blocks away. Perfect for duplicating builds.

How do I set the time of day in Minecraft?

Use /time set command: '/time set day' for daytime, '/time set night' for nighttime, '/time set 6000' for noon, '/time set 18000' for midnight.

How do I change the weather in Minecraft?

Use /weather command: '/weather clear' for sunny weather, '/weather rain' for rain, '/weather thunder' for thunderstorms. Add duration in seconds.

How do I give players potion effects?

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.

How do I spawn a specific number of mobs?

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.

How do I create custom fireworks in Minecraft?

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.

Complete Minecraft Java Commands Guide

Essential Commands for Beginners

The most basic and useful commands every Minecraft player should know

Gamemode/gamemode <mode>

Changes your game mode to survival, creative, adventure, or spectator

Examples:

  • /gamemode creative - Switch to creative mode
  • /gamemode survival - Switch to survival mode
  • /gamemode adventure - Switch to adventure mode
  • /gamemode spectator - Switch to spectator mode
  • /gamemode c/s/a/sp - Use shorthand versions
Teleport/tp [target] <location> [<yRot> <xRot>]

Teleports players or entities to specific coordinates, other entities, or with specific rotation

Examples:

  • /tp @s ~ ~5 ~ - Teleport yourself 5 blocks up
  • /tp @s 100 64 -200 facing 120 70 -180 - Teleport to coordinates and face another position
  • /tp @s ~ ~ ~ 90 45 - Teleport in place but rotate to face east and look down at 45°
  • /tp @s @e[type=minecraft:village,limit=1,sort=nearest] - Teleport to the nearest village
  • /tp @e[type=zombie,distance=..50] @s - Teleport all zombies within 50 blocks to you
  • /execute in minecraft:the_nether run tp @s ~ 100 ~ - Teleport to the Nether at y-level 100
Give/give <player> <item> [amount]

Gives items to players, with optional NBT data for custom properties

Examples:

  • /give @s minecraft:diamond 64 - Give yourself 64 diamonds
  • /give @s minecraft:diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:5},{id:"minecraft:looting",lvl:3}]} - Give enchanted sword
  • /give @s minecraft:potion{CustomPotionEffects:[{Id:1,Amplifier:3,Duration:9600}]} - Give custom speed potion
  • /give @s minecraft:written_book{pages:['{"text":"My Custom Book"}'],title:"Guide",author:"Me"} - Give written book
  • /give @s minecraft:netherite_pickaxe{display:{Name:'{"text":"Miner's Dream","italic":false,"color":"gold"}'},Enchantments:[{id:"minecraft:efficiency",lvl:5},{id:"minecraft:fortune",lvl:3}]} - Named enchanted pickaxe
Locate/locate <structure|biome> <name>

Finds the nearest specified structure or biome

Examples:

  • /locate structure minecraft:stronghold - Find nearest stronghold
  • /locate structure minecraft:village - Find nearest village
  • /locate structure minecraft:nether_fortress - Find nearest Nether fortress
  • /locate biome minecraft:jungle - Find nearest jungle biome
  • /locate structure minecraft:end_city - Find nearest End City
Seed/seed

Displays the seed of the current world

Examples:

  • /seed - Show the current world seed

Player & World Modification Commands

Commands that modify player states and world properties

Effect/effect <give|clear> <target> [effect] [seconds] [amplifier]

Adds or removes status effects from players

Examples:

  • /effect give @s minecraft:speed 60 2 - Give yourself Speed II for 60 seconds
  • /effect give @s minecraft:night_vision 1000 - Give yourself night vision
  • /effect give @s minecraft:resistance 999999 255 - Give yourself maximum resistance
  • /effect give @s minecraft:invisibility 3600 0 true - Give invisibility without particles
  • /effect clear @s - Remove all effects from yourself
Weather/weather <type> [duration]

Changes the weather to clear, rain, or thunder

Examples:

  • /weather clear - Set weather to clear
  • /weather rain - Make it rain
  • /weather thunder - Start a thunderstorm
  • /weather clear 6000 - Clear weather for 5 minutes
Time/time <set|add|query> <value>

Changes or queries the game time

Examples:

  • /time set day - Set time to day
  • /time set night - Set time to night
  • /time set 6000 - Set time to noon
  • /time add 1000 - Add 1000 ticks to current time
  • /time query daytime - Show current time in ticks
Gamerule/gamerule <rule> [value]

Sets or queries game rules that control aspects of gameplay

Examples:

  • /gamerule keepInventory true - Keep inventory after death
  • /gamerule doDaylightCycle false - Stop day/night cycle
  • /gamerule doWeatherCycle false - Stop weather changes
  • /gamerule mobGriefing false - Prevent mob destruction
  • /gamerule doInsomnia false - Prevent phantoms from spawning
Worldborder/worldborder <set|add|center|damage|warning> [value]

Controls the world border size, position, and effects

Examples:

  • /worldborder set 1000 - Set border to 1000×1000 blocks
  • /worldborder center ~ ~ - Center border on your position
  • /worldborder add 500 120 - Gradually expand border by 500 blocks over 2 minutes
  • /worldborder damage amount 5 - Set damage to 5 per second when outside border
  • /worldborder warning time 15 - Set warning 15 seconds before crossing

Advanced & Creative Commands

More complex commands for server admins and map makers

Summon/summon <entity> [pos] [nbt]

Summons an entity at a specific location, with optional NBT data for customization

Examples:

  • /summon minecraft:lightning_bolt ~ ~ ~ - Strike lightning at your position
  • /summon minecraft:zombie ~ ~ ~ {IsBaby:1,CustomName:'{"text":"Mini Zombie"}',ArmorItems:[{},{},{},{id:"minecraft:diamond_helmet",Count:1b}]} - Spawn a named baby zombie with a diamond helmet
  • /summon minecraft:horse ~ ~ ~ {Tame:1,SaddleItem:{id:"minecraft:saddle",Count:1b},Attributes:[{Name:"generic.movement_speed",Base:0.4}]} - Spawn a fast, tamed, saddled horse
  • /summon minecraft:villager ~ ~ ~ {VillagerData:{profession:"librarian",level:5,type:"plains"},Offers:{Recipes:[{buy:{id:"minecraft:emerald",Count:1b},sell:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:mending",lvl:1s}]}}}]}} - Spawn a librarian villager selling Mending books
  • /summon minecraft:armor_stand ~ ~ ~ {Invisible:1b,Marker:1b,CustomNameVisible:1b,CustomName:'{"text":"Checkpoint","color":"green"}',ArmorItems:[{},{},{},{id:"minecraft:player_head",Count:1b}]} - Create an invisible labeled checkpoint marker
Fill/fill <x1> <y1> <z1> <x2> <y2> <z2> <block> [mode]

Fills a region with specific blocks, with options for replacing or destroying existing blocks

Examples:

  • /fill ~-5 ~ ~-5 ~5 ~5 ~5 minecraft:stone - Fill a 11x6x11 area with stone
  • /fill ~-10 ~-1 ~-10 ~10 ~-1 ~10 minecraft:grass_block replace minecraft:water - Replace water with grass in an area
  • /fill ~-3 ~ ~-3 ~3 ~3 ~3 minecraft:air replace minecraft:tnt - Remove all TNT in an area (defuse a trap)
  • /fill ~ ~-1 ~ ~20 ~-1 ~20 minecraft:redstone_block replace minecraft:stone - Create a redstone floor trigger
  • /fill ~-5 ~ ~-5 ~5 ~10 ~5 minecraft:air hollow - Create a hollow air cube (clear a building space)
Clone/clone <x1> <y1> <z1> <x2> <y2> <z2> <x> <y> <z> [mode]

Copies blocks from one region to another

Examples:

  • /clone ~-5 ~ ~-5 ~5 ~5 ~5 ~-5 ~10 ~-5 - Clone a structure 10 blocks higher
  • /clone 0 64 0 10 70 10 20 64 0 - Copy a structure to a new location
  • /clone 5 5 5 10 10 10 15 5 15 replace move - Move structure to new location
  • /clone ~-5 ~ ~-5 ~5 ~5 ~5 ~-5 ~10 ~-5 filtered minecraft:diamond_ore - Clone only diamond ore blocks
  • /clone ~-10 ~-10 ~-10 ~10 ~10 ~10 ~-10 ~-10 ~-10 replace force - Clone even if destination overlaps source
Scoreboard/scoreboard <objectives|players> <...>

Creates and manages scoreboards for tracking statistics and custom values

Examples:

  • /scoreboard objectives add Kills playerKillCount "Player Kills" - Create kill counter
  • /scoreboard objectives setdisplay sidebar Kills - Show kills on sidebar
  • /scoreboard players set @s Money 1000 - Set your Money score to 1000
  • /scoreboard players add @a Points 10 - Add 10 points to all players
  • /scoreboard players operation @s Total += @s Points - Add Points to Total score
Title/title <target> <title|subtitle|actionbar|...> <json text>

Displays title, subtitle, or action bar text to players

Examples:

  • /title @a title {"text":"Game Starting","color":"gold"} - Show gold title to all players
  • /title @a subtitle {"text":"Get ready!","color":"red"} - Show red subtitle to all players
  • /title @a actionbar {"text":"10 seconds remaining","color":"yellow"} - Show yellow action bar text
  • /title @a times 10 70 20 - Set fade in (10), stay (70), and fade out (20) times
  • /title @a title {"text":"Level ","extra":[{"score":{"name":"*","objective":"Level"}}]} - Show dynamic title with scoreboard value
Bossbar/bossbar <add|remove|set|get|list> ...

Creates and manages boss bars at the top of the screen for displaying progress, timers, or important information

Examples:

  • /bossbar add minecraft:timer "Time Remaining" - Create a new bossbar with ID 'timer'
  • /bossbar set minecraft:timer color red - Set the bossbar color to red
  • /bossbar set minecraft:timer style notched_6 - Set the bossbar style to 6 notches
  • /bossbar set minecraft:timer value 50 - Set the bossbar to 50% full
  • /bossbar set minecraft:timer players @a - Show the bossbar to all players
  • /bossbar set minecraft:timer max 300 - Set the maximum value to 300
  • /bossbar remove minecraft:timer - Remove the bossbar

Server & Administrative Commands

Commands for managing servers and players

Op/op <player>

Grants operator status to a player

Examples:

  • /op PlayerName - Make a player an operator
Whitelist/whitelist <add|remove|list|on|off|reload> [player]

Manages the server whitelist

Examples:

  • /whitelist add PlayerName - Add player to whitelist
  • /whitelist on - Enable the whitelist
  • /whitelist list - List all whitelisted players
  • /whitelist reload - Reload the whitelist from file
  • /whitelist off - Disable the whitelist
Gamemode (Server)/defaultgamemode <mode>

Sets the default game mode for new players joining the server

Examples:

  • /defaultgamemode survival - Set default mode to survival
  • /defaultgamemode creative - Set default mode to creative
  • /defaultgamemode adventure - Set default mode to adventure
  • /defaultgamemode spectator - Set default mode to spectator
Difficulty (Server)/difficulty <peaceful|easy|normal|hard>

Sets the game difficulty level for the entire server

Examples:

  • /difficulty peaceful - Set to peaceful mode
  • /difficulty easy - Set to easy difficulty
  • /difficulty normal - Set to normal difficulty
  • /difficulty hard - Set to hard difficulty
Ban & Pardon/ban <name> [reason] or /pardon <name>

Bans or unbans players from the server

Examples:

  • /ban PlayerName - Ban a player
  • /ban PlayerName Griefing - Ban with reason
  • /pardon PlayerName - Unban a player
  • /ban-ip 192.168.1.1 - Ban an IP address
  • /pardon-ip 192.168.1.1 - Unban an IP address

How to Enable Commands in Minecraft

Before you can use these commands, you need to enable cheats:

  • For existing worlds: Open the world → Pause menu → Open to LAN → Enable cheats: ON → Start LAN World
  • For new worlds: Create New World → Allow Cheats: ON
  • For servers: Set "enable-command-block=true" in server.properties and make yourself an operator

Frequently Asked Questions About Minecraft Commands

CraftMC

Your ultimate resource for Minecraft tools and guides.

Professional ToolsExpert GuidesActive Support

Popular Tools

Quick Links

© 2026 CraftMC. All rights reserved.