Editing
MinecraftCommands
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== setblock === {{/infobox |setblock |op |1.7.2|13w37a }} Changes a block to another block. ;Syntax : <code>setblock <''x''> <''y''> <''z''> <''TileName''> [''dataValue''] [''oldBlockHandling''] [''dataTag'']</code> ;Arguments : ''x y z'' :: Specifies the position of the block to be changed. May use [[#Tilde notation|tilde notation]] to specify a position relative to the command's execution. : ''TileName'' :: Specifies the new block. Must be a [[Data values#Block IDs|block id]] (for example, <code>minecraft:stone</code> or <code>stone</code>). : ''dataValue'' (optional) :: Specifies additional data to further describe the new block. Must be between 0 and 15 (inclusive). If not specified, defaults to <code>0</code>. : ''oldBlockHandling'' (optional) :: Specifies how to handle the block change. Must be one of: ::* <code>destroy</code> β The old block drops both itself and its contents (as if destroyed by a player). Plays the appropriate block breaking noise. ::* <code>keep</code> β Only air blocks will be changed (non-air blocks will be "kept"). ::* <code>replace</code> β The old block drops neither itself nor any contents. Plays no sound. :: If not specified, defaults to <code>replace</code>. : ''dataTag'' (optional) :: Specifies the [[#Data tag|data tag]] for the new block. Must be a compound [[NBT tag]] (for example, <code>{CustomName:Fred}</code>). ;Result : Fails if the arguments are not specified correctly, if tried to change a non-air block in keep mode, tried to replace a block with an identical copy in keep or replace mode, or if the coordinates are in an unloaded chunk. : On success, changes the block at the specified position. ;See also :* {{cmd|blockdata}} β modifies the data tags of a block :* {{cmd|clone}} β copies blocks from one region to another :* {{cmd|fill}} β fills a region with a block <!-- please retain double newline above for section differentiation -->
Summary:
Please note that all contributions to Hegemon Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Hegemon Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information