Minecraft Commands for Building.
Transform creative construction with instant world editing commands. Master 3D coordinate grids, mass block replacement with /fill, non-destructive structure duplication with /clone, and precision placement with /setblock.
Mastering Minecraft Coordinates: Absolute, Relative, and Local
Every block manipulation command requires coordinate targets. Understanding the three coordinate notations prevents misplaced structures and accidental chunk damage.
Absolute Coordinates
Points to a fixed, exact world location independent of where you stand. Press F3 in Java or enable Show Coordinates in Bedrock settings to view your current world position.
/setblock 120 70 -45 stoneRelative Coordinates (Tilde ~)
Offsets positions relative to where the command executor is standing. ~ means your current axis, ~5 means 5 blocks East or Up, and ~-5 means 5 blocks in the negative direction.
~ ~-1 ~ = The block directly beneath your feet.Local Coordinates (Caret ^)
Offsets based on the player's viewing angle (crosshair). ^Left ^Up ^Forward. If you look upwards, ^ ^ ^5 places the block 5 blocks in front of your eyes in the sky.
^ ^ ^3 = 3 blocks directly in front of crosshair.The /fill Command: Mass Construction & Land Clearing
Fill creates cuboid volumes up to 32,768 blocks in a single execution.
The syntax structure for /fill is:
Fill Keyword Modes Explained:
Replaces every block inside the defined box. If a filter block is specified (e.g. replace water), only matching blocks are swapped, leaving surrounding terrain untouched.
Fills only the outer 1-block perimeter with the designated block and turns all inner blocks into air. Essential for generating instant rooms, houses, and underground bunkers.
Builds only the outer perimeter walls, floor, and ceiling, but leaves all interior blocks intact without replacing them with air.
Only places blocks into air spaces. Existing terrain, ores, and player-built blocks inside the coordinates are never overwritten.
Using /fill ... air destroy breaks every block as if mined by a player, dropping thousands of floating item entities. Filling large areas with destroy can crash low-spec servers or drop FPS to 1. To clear land smoothly, always use /fill ... air replace instead.
The /clone Command: Copying & Relocating Structures
Duplicate buildings, towers, or redstone contraptions across coordinates without third-party external mods.
The syntax structure for /clone requires three 3D coordinate pairs:
The "Minimum Coordinate Anchor" Rule:
The most common mistake when using /clone is misunderstanding where the structure pastes. In Minecraft, the destination coordinate corresponds to the lowest X, lowest Y, and lowest Z coordinate of your source bounding box (the Northwest bottom corner). It does not paste relative to your current standing position unless specified with tildes.
Mask Modes vs Clone Modes
Copies only solid and functional blocks. Air blocks inside the source box are ignored, allowing you to paste structures onto uneven terrain without erasing hills.
The default mode. Copies every single block, overwriting target destination blocks with air wherever air existed in the source.
Performs a cut-and-paste. Clones the structure to the destination and replaces the original source coordinates with air.
Forces the clone operation even if the source and destination overlap (e.g. nudging a bridge 2 blocks to the left).
Ready-to-Use Builder Command Recipes
Copy and paste these verified commands directly into Minecraft chat for instant construction.
1. Instant 20x5 Stone Wall
Relative/fill ~ ~ ~ ~20 ~5 ~ stoneConstructs a solid stone wall extending 20 blocks East and 5 blocks high from where you are currently standing.
2. 21x21 Oak Floor Platform
Floor Level/fill ~-10 ~-1 ~-10 ~10 ~-1 ~10 oak_planksCreates a flat 21x21 wooden platform directly beneath your feet, centered exactly around your position.
3. Clear 30x10x30 Basement
Air Replace/fill ~-15 ~-10 ~-15 ~15 ~-1 ~15 airExcavates a massive underground room 10 blocks deep without dropping floating item entities.
4. Hollow 15x15 Glass Box
Hollow Mode/fill ~-7 ~ ~-7 ~7 ~10 ~7 glass hollowCreates a hollow glass enclosure 11 blocks high with all inner blocks cleared to air automatically.
Syntax and coordinates reference.
A quick reference cheat sheet explaining target selectors, absolute coordinate grids, relative offsets, and local direction-facing grids.
Target Selectors
Minecraft uses shorthand variables called "target selectors" to target specific players or entities without writing full usernames.
Nearest Player
Targets the single player closest to where the command is executed.
All Players
Targets every online player in the current dimension/world.
Random Player
Targets one random player (commonly used in minigames/lobbies).
All Entities
Targets all living things, including players, mobs, dropped items, and item frames.
Self (Executor)
Targets the entity currently running the command (useful in command blocks and chat).
Pro Tip: Selector Arguments
You can filter selectors using square brackets: @e[type=zombie,r=10] targets all zombies within a 10-block radius in Bedrock, or distance=..10 in Java.
Coordinate systems
Minecraft locations use a 3D grid layout represented as X Y Z coordinates (East/West, Altitude, North/South).
Absolute Coordinates
Specifies an exact point on the world map. 100 64 -250 means block X=100 (East), Y=64 (Sea Level elevation), Z=-250 (North).
Relative Coordinates (Tilde)
Specifies block offsets relative to the execution origin. E.g., ~ ~5 ~ represents exactly 5 blocks directly above where the command runs.
Local Coordinates (Caret)
Specifies block offsets relative to where the executing entity is currently looking (Left/Right, Up/Down, Forward/Backward). E.g., ^ ^ ^5 is 5 blocks directly in front of the executor's face.
| Axis | Positive Value (+) | Negative Value (-) |
|---|---|---|
| X Axis | Eastward displacement | Westward displacement |
| Y Axis | Upward altitude (Sky) | Downward altitude (Void) |
| Z Axis | Southward displacement | Northward displacement |
Filtered building codes list
Search and filter commands.
No commands match your search.
Try checking the spelling or resetting your filters. Make sure you have the correct game edition selected.
Gives an item to one or more players, with optional counts, metadata, and components.
Command Arguments
Target entity receiving the items (e.g., @p nearest, @a all, or an exact gamer tag).
The official identifier of the item (e.g., minecraft:diamond_sword in Java, diamond_sword in Bedrock).
Number of items to give. Defaults to 1 if omitted. Can exceed 64 in Java for unstackables.
Java 1.20.5+ square-bracket components (e.g. [enchantments={levels:{"sharpness":5}}]) or Bedrock adventure JSON (can_place_on / can_destroy).
Examples
Teleports entities (players, mobs, etc.) to a specific coordinate or destination entity.
Command Arguments
The entity or entities to teleport (e.g. @s, @p, @a[team=red], @e[type=horse]).
The destination entity to teleport targets directly to.
Destination coordinate grid. Supports absolute (100 64 -200), relative (~ ~5 ~), or local caret (^ ^ ^2) coordinates.
Optional facing rotation. yRot is horizontal yaw (-180 to 180), xRot is vertical pitch (-90 straight up to 90 straight down).
Examples
Changes the game mode of a player (Survival, Creative, Adventure, or Spectator).
Command Arguments
The mode to set: survival, creative, adventure, or spectator (spectator is Java only).
The player whose game mode to change. Defaults to yourself if omitted.
Examples
Spawns a specified entity (mob, projectile, item frame, etc.) at coordinates.
Command Arguments
The identifier of the mob or entity to spawn (e.g. minecraft:zombie, creeper, armor_stand).
Coordinates where the entity will appear. Defaults to current position (~ ~ ~).
Curly-brace NBT tags configuring mob health, gear, AI, custom names, and passenger riding stacks.
Bedrock spawn event modifying entity behavior (e.g. minecraft:as_baby, minecraft:become_charged).
Custom text nametag to display over the spawned entity.
Examples
Sets or checks game rules (e.g. keepInventory, mobGriefing, doDaylightCycle).
Command Arguments
The name of the gamerule (e.g., keepInventory, doDaylightCycle). Case sensitive!
The setting to apply. Boolean rules take true/false, integer rules take numbers.
Examples
Applies or removes status effects (speed, strength, poison, etc.) on entities.
Command Arguments
Specify whether to bestow or wipe away potion effects.
Target entity or players (e.g. @s, @p, @a[team=blue], @e[type=zombie]).
Status effect identifier (e.g. minecraft:speed, regeneration, night_vision).
Duration in seconds (up to 1,000,000) or "infinite" in modern Java.
Power level: 0 is Level I, 1 is Level II, up to 255 (maximum potency).
Set to true to hide ambient swirling potion bubbles from player vision.
Examples
Executes another command on behalf of one or more entities with conditional filters.
Command Arguments
Changes who the executor (@s) is, without moving where the command runs.
Changes execution position (~ ~ ~), rotation, and dimension to match the entity.
Explicitly moves the execution location to coordinates (absolute or relative).
Executes within minecraft:overworld, the_nether, or the_end.
Evaluates block matches, entity counts, score comparisons, or predicates before running.
Stores the numeric result or success count of the command into a scoreboard or NBT path.
The terminating command executed if all modifiers and condition checks succeed.
Examples
Finds the nearest structure, biome, or point of interest (POI) and prints coordinates in chat.
Command Arguments
Choose whether you are finding a structure, a biome, or a point of interest.
The namespace of the structure/biome (e.g. desert_pyramid, cherry_grove).
Examples
Fills all or parts of a specified region with a specific block type.
Command Arguments
First corner of the 3D cuboid bounding box.
Opposite diagonal corner of the bounding box.
Block type to place (e.g. minecraft:stone, glass, oak_planks).
Handling mode: replace (default), keep (fills air only), outline (outer perimeter shell), hollow (outer shell with air center), destroy (breaks blocks dropping items).
When mode is replace, only blocks matching this ID will be substituted.
Examples
Changes a single block at specified coordinates to a new block type, with optional block state properties and replacement modes.
Command Arguments
Coordinates of the target block (absolute X Y Z or relative ~ ~ ~).
Block identifier to place (e.g. minecraft:redstone_block, air, oak_door).
replace (default, overwrites silently), keep (only places if target is air), destroy (breaks existing block with particles and drops).
Java square-bracket states (e.g. [facing=north,lit=true]) or Bedrock tileData integer/states.
Examples
Duplicates or moves all blocks from a source bounding box to a destination coordinate, supporting masking filters and overlap modes.
Command Arguments
First corner of the source cuboid bounding box.
Opposite diagonal corner of the source bounding box.
The lower northwest corner (minimum X, minimum Y, minimum Z) where the cloned region will be pasted.
replace (copies all blocks including air, default), masked (copies non-air blocks only), filtered (copies only blocks matching a specific block ID).
normal (fails if source and destination overlap, default), force (allows overlapping regions), move (cuts and pastes: replaces source with air).
Examples
Inspects, modifies, merges, or removes NBT data on block entities, non-player entities, and persistent command storage.
Command Arguments
The data operation: get (reads value), merge (combines NBT), modify (sets/appends/prepends values), remove (deletes tag).
Target container: a block entity at coordinates, a single non-player entity, or command storage namespace.
NBT tag key or array path (e.g. Health, Items[0].count, custom_data.score).
Examples
Tracks, modifies, and displays custom objectives, player scores, timers, and statistics for game logic, economy, and leaderboard systems.
Command Arguments
Specify whether managing objective definitions or player score values.
The score operation to perform.
Objective name identifier (e.g. Coins, Deaths, Timer).
Tracking metric: dummy (manual score), deathCount, health, or playerKillCount.
Examples
Applies a screen shaking effect to players, useful for cinematics or custom maps.
Command Arguments
Choose whether to shake or stop shaking the screen.
The players who will experience the screen shake.
Strength of shake (0.0 to 4.0). Defaults to 1.0.
Duration in seconds. Defaults to 1.0.
Whether the camera shifts position or rotates. Defaults to positional.
Examples
Creates, lists, or removes ticking areas, forcing the game to simulate chunks even when no players are nearby.
Command Arguments
Add, list, or remove ticking areas.
Bounding box coordinates for a rectangular ticking area.
Circle radius in chunks (1 to 4) when using circle mode.
Examples
Forces chunks to constantly load and simulate, even if no players are nearby. Equivalent to ticking areas.
Command Arguments
Force load, stop force loading, or query chunks.
Coordinates defining the chunk range.
Examples
Controls the boundaries and size of the world border.
Command Arguments
Border control action.
Diameter of border in blocks.
Examples
Sets character abilities (like World Builder permissions, flying, or mute) on a player.
Command Arguments
The player whose ability to set.
worldbuilder (build/edit blocks), mayfly (Creative fly), mute (chat mute).
Set true to enable, false to disable.
Examples
Triggers dialogue screens or forces an NPC to display a dialogue branch to players.
Command Arguments
Open a dialog panel or switch active NPC scene.
The NPC entity presenting the dialogue.
The target player to show the dialog to.
Examples
Creates and customizes floating boss status bars at the top of the player screen.
Command Arguments
Modify, show, or delete boss bars.
Unique namespace ID for the custom boss bar.
Display name of the boss bar (e.g. {"text":"King Slime"}).
Examples
Gives a player an overpowered Netherite Sword with level 255/10 enchantments.
Command Arguments
Who to give the God Sword to.
The number of swords to give. Defaults to 1.
Examples
Gives a player a stick with Knockback level 10,000, sending targets flying into the distance.
Command Arguments
Who to give the Knockback Stick to.
The number of sticks to give. Defaults to 1.
Examples
Gives a player a Netherite Chestplate with Protection level 255 and Thorns 10, rendering the wearer practically invincible.
Command Arguments
Who to give the God Chestplate to.
The number of chestplates to give. Defaults to 1.
Examples
Gives a player a Netherite Pickaxe with Efficiency level 255, breaking blocks instantly.
Command Arguments
Who to give the Instamine Pickaxe to.
The number of pickaxes to give. Defaults to 1.
Examples
Gives a player a Bow with Power level 255, Punch level 10, Flame, and Infinity.
Command Arguments
Who to give the God Bow to.
The number of bows to give. Defaults to 1.
Examples
Gives a player a stack of custom food items (cookies) that grant Strength level 255 and Resistance level 255 for one minute.
Command Arguments
Who to give the OP Cookie to.
The number of cookies to give (1-64). Defaults to 64.
Examples
Gives a player a Netherite Axe with Efficiency level 255, Sharpness level 255, Looting level 10, Unbreaking level 255, and Mending.
Command Arguments
Who to give the God Axe to.
The number of axes to give. Defaults to 1.
Examples
Gives a player a Netherite Helmet with Protection level 255, Respiration level 3, Aqua Affinity, and Unbreaking level 255.
Command Arguments
Who to give the God Helmet to.
The number of helmets to give. Defaults to 1.
Examples
Gives a player Netherite Leggings with Protection level 255, Swift Sneak level 3, Unbreaking level 255, and Mending.
Command Arguments
Who to give the God Leggings to.
The number of leggings to give. Defaults to 1.
Examples
Gives a player Netherite Boots with Protection level 255, Feather Falling level 255, Depth Strider level 3, Soul Speed level 3, Unbreaking level 255, and Mending.
Command Arguments
Who to give the God Boots to.
The number of boots to give. Defaults to 1.
Examples
Gives a player a Trident with Impaling level 255, Loyalty level 10, Channeling, Unbreaking level 255, and Mending.
Command Arguments
Who to give the God Trident to.
The number of tridents to give. Defaults to 1.
Examples
Gives a player an OP God Elixir potion that grants Strength 255, Resistance 255, Regeneration 255, Speed 10, Haste 10, and more for 10 minutes.
Command Arguments
Who to give the OP God Elixir to.
The number of potions to give. Defaults to 1.
Examples
Manages the server player whitelist, allowing only approved players to join the server.
Command Arguments
The whitelist action to perform.
The username of the player to add or remove.
Examples
Disconnects a specified player from the server immediately, optionally displaying a reason.
Command Arguments
The player or targets to kick.
The reason for the kick, shown to the player upon disconnection.
Examples
Adds a player to the server's blacklist (ban list), preventing them from reconnecting.
Command Arguments
The player or targets to ban.
Reason for the ban, visible to the player when trying to connect.
Examples
Removes a player from the server's ban list, permitting them to join the server again.
Command Arguments
The name of the player to unban.
Examples
Reloads all data packs, functions, advancements, and loot tables from disk.
Examples
Controls the server tick rate and flow, allowing developers to freeze, step, or sprint game execution for diagnostic testing.
Command Arguments
Tick control action to perform.
Specific target values, such as ticks/second (rate) or duration (step/sprint).
Examples
Starts or stops recording performance metrics, generating a diagnostic ZIP report in the server's debug folder.
Command Arguments
Whether to start or stop the performance diagnostic recording.
Examples
Manages the server's loaded data packs, allowing creators to dynamically enable, disable, and order them.
Command Arguments
Specifies whether to load, unload, or list data packs.
The file folder name or zip archive name of the datapack.
Examples
Forces the server to save all pending chunks, player profiles, and world data to disk immediately.
Command Arguments
Optional argument to force blocking and flush all files immediately.
Examples
Runs a function script file (.mcfunction) containing a sequence of commands in a single game tick.
Command Arguments
Namespace location of the function (e.g. namespace:function_name).
Examples
Generates overpowered 32k God weapons, armor, tools, and custom potion elixirs.
Command Arguments
Overpowered god item preset (e.g. 32k god sword, invincible armor, knockback stick).
Target player receiving the overpowered item.
Quantity of the item to give (1-64).