How to place a block with a command — the /setblock command
Generator /setblock
Place a block at coordinates — adjust the parameters and copy the finished result
The /setblock command places a single block at the specified coordinates. Use ~ for relative coordinates.
Coordinates
Use ~ for relative coordinates
Block
Mode
Generated command
Paste it into the Minecraft chat (the T key) or a command block
Other commands
/give
Give an item to a player
/summon
Summon a mob or entity
/effect
Apply an effect to a player
/enchant
Enchant the item in hand
/gamemode
Change game mode
/tp
Teleport a player
/time
Change the time of day
/weather
Change the weather
/xp
Give experience to a player
/difficulty
Change world difficulty
/gamerule
Change world rules
/clear
Clear a player's inventory
/fill
Fill an area with blocks
/spawnpoint
Set the spawn point
How does /setblock work?
The /setblock command places a single block at the specified coordinates. Syntax: /setblock <x> <y> <z> <block> [mode]. Modes: replace (replacement, default), destroy (with drops), keep (only if air).
Relative coordinates
Use ~ for relative coordinates: /setblock ~ ~-1 ~ minecraft:diamond_block — places a diamond block under your feet. ~1 ~0 ~0 — one block to the east.
Placement modes
replace — replaces any block. destroy — destroys the existing block with a drop, then places the new one. keep — places the block only if there is air in that spot (does not replace existing blocks).
Removing blocks
To remove a block, place air: /setblock <x> <y> <z> minecraft:air. This works with any blocks, including bedrock and barriers, which cannot be broken in survival.
Looking for Minecraft server hosting?
Launch your server in a minute — one-click mod and plugin installation, DDoS protection, powerful hardware. Promo code PROMO10 gives 10% off any plan.
