Choose a command Available editors: 23 / 23

Choose a command or select its information icon to see how it works.

Players and items

World and building

Display and game systems

/setblock

Editor available

What does it do?

Need to place one block at an exact location, even from far away? This command sets a chosen block at specific coordinates.

When is it useful?

Useful for mechanisms, maps, automated builds, and command blocks.

Example

/setblock ~ ~ ~ minecraft:stone

What will happen?

Stone is placed at the command's execution position.

Good to know

Depending on the options, an existing block may be replaced.

Minecraft Java

/setblock

Place a block at specific coordinates and preview its texture in 3D.

Total visits 74My visits 0

Command settings

Coordinates
Absolute, ~ relative or ^ local coordinates

Generated command

/setblock …

3D block preview

The texture from the selected version's atlas is shown on a simplified block model.
Where the block goes

Enter X, Y and Z. For example, ~ ~1 ~ places a block one block above the execution position.

How to orient a block

Enter a property supported by the selected block. For example, axis=x aligns a log along the X axis.

How to avoid overwriting

Keep places the block only in air. Replace replaces the existing block, and Destroy breaks it and drops items if applicable.

FAQ Frequently asked questions 30 questions
Essential questions 5
What is /setblock used for?

It places or replaces one block at a specified world position, useful for building and command mechanisms.

How does /setblock differ from /fill?

/setblock modifies one block position, while /fill changes an entire rectangular region.

Can /setblock remove a block?

Yes. Specify minecraft:air as the replacement block to clear the target position when the command succeeds.

How do I place stone beneath a player?

Use /setblock ~ ~-1 ~ minecraft:stone. It changes the block below the execution position when the coordinates are valid.

Can I place a block with a direction?

Yes. Supported block states let you specify orientation, such as a chest's facing or a stair block's direction.

Syntax and arguments 5
What is the full /setblock syntax?

Java uses /setblock <position> <block> [mode]. Modern versions support replace, keep, destroy and strict.

How is the block position specified?

Provide X Y Z coordinates. These can be absolute integer positions or supported relative coordinates.

What does replace mode do?

It replaces the existing block without normal item drops. This is the default behavior when no mode is specified.

What does keep mode do?

The keep mode places the new block only where the target is air. Existing non-air blocks remain unchanged.

What does destroy mode do?

It processes destruction of the old block, including possible item drops, before placing the replacement block.

Practical examples 5
How do I place a block at exact coordinates?

Enter /setblock 100 70 200 minecraft:stone. The command changes that position when the area is accessible.

How do I place glass above a player?

Use /setblock ~ ~1 ~ minecraft:glass. The position is calculated relative to command execution.

How do I place an east-facing chest?

Use /setblock ~ ~ ~ minecraft:chest[facing=east]. The command specifies the chest orientation through its block state.

How do I place a block only in an empty space?

Enter /setblock ~ ~-1 ~ minecraft:stone keep. Replacement does not occur when a non-air block occupies the position.

How do I remove only one block?

Use /setblock with minecraft:air and exact coordinates. Verify the target position before executing it.

Advanced usage 5
Can I configure stair block states?

Yes. For supported stairs, facing controls direction and half determines whether the stair occupies its upper or lower position.

What is a block state?

It is a placed-block property such as direction, shape, liquid level or orientation. Supported states vary by block type.

Can I place blocks with additional data?

Some Java Edition blocks support block entity data. Use the format compatible with your specific game version.

What is strict mode for?

In supported Java versions, it places the block without ordinary shape and neighbor updates during execution.

Can /setblock run through /execute?

Yes. /execute can establish another position, dimension or execution condition before modifying the block.

Troubleshooting 4
Why does the command fail to place a block?

Possible causes include invalid coordinates, unloaded areas, unsupported states or keep mode targeting an occupied position.

Why did keep mode change nothing?

When a non-air block already occupies the target position, keep leaves it unchanged. Check the target position.

Why does a placed block immediately disappear?

Some blocks require support or suitable neighboring states. Ordinary world updates can remove an improperly placed block.

Why does the facing property fail?

Not every block supports facing or the same direction values. Check the valid states for the selected block.

Minecraft versions 3
When was strict mode introduced?

Java Edition 1.21.5 introduced strict. Commands using this mode are not supported unchanged in older releases.

Is /setblock identical in Java and Bedrock?

No. The editions can use different block-state formats and additional arguments. This guide targets Java Edition.

Has block data syntax changed over time?

Yes. Some block data structures and command syntax have changed across Minecraft Java Edition versions.

Permissions and safety 3
What permissions does /setblock require?

Java Edition normally requires permission level 2. Command-based block modification should be restricted on public servers.

Does /setblock provide automatic undo?

No. Restoring the previous block requires knowledge of its old state or an appropriate backup.

How do I safely test the command?

First use an empty test area, verify coordinates and placement mode, then apply the command near important structures.

Minecraft Wiki reference

Reviews for this page

No published reviews yet.

All WopBlockStudio reviews

Rate this tool

Did this tool work for you? Tell us what went well or what could improve.

Sign in to leave a review
Rating from 1 to 5