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!
=== fill === {{/infobox |fill |op |1.8|14w03a }} Fills all or parts of a region with a specific block. ;Syntax : <code>fill <span style="background-color:#FDD"><''x1''> <''y1''> <''z1''></span> <span style="background-color:#DDF"><''x2''> <''y2''> <''z2''></span> <''TileName''> [''dataValue''] [''oldBlockHandling''] [''dataTag'']</code> : The fill command also has an optional alternate syntax when using the <code>replace</code> option: : <code>fill <span style="background-color:#FDD"><''x1''> <''y1''> <''z1''></span> <span style="background-color:#DDF"><''x2''> <''y2''> <''z2''></span> <''TileName''> <''dataValue''> replace [''replaceTileName''] [''replaceDataValue'']</code> : ''Color added to make reading easier.'' ;Arguments : <span style="background-color:#FDD">''x1 y1 z1''</span> and <span style="background-color:#DDF">''x2 y2 z2''</span> :: Specifies any two opposing corner blocks of the region to be filled (the "fill region"). May use [[#Tilde notation|tilde notation]] to specify distances relative to the command's execution. :: The blocks that make up the corners extend in the positive direction from the coordinates used to identify them. Because of this, the lesser coordinates of each axis will be right on the region boundary, but the greater coordinates will be one block from the boundary, and the block volume of the source region will be (x<sub>greater</sub> - x<sub>lesser</sub> + 1) Γ (y<sub>greater</sub> - y<sub>lesser</sub> + 1) Γ (z<sub>greater</sub> - z<sub>lesser</sub> + 1). For example, <code>0 0 0 0 0 0</code> has a 1-block volume, and <code>0 0 0 1 1 1</code> and <code>1 1 1 0 0 0</code> both identify the same region with an 8-block volume. : ''TileName'' :: Specifies the block to fill the region with. Must be a [[Data values#Block ID|block id]] (for example, <code>minecraft:stone</code>). : ''dataValue'' (optional) :: Specifies the block data to use for the fill block. Must be between 0 and 15 (inclusive). : ''oldBlockHandling'' (optional) :: Must be one of: ::* <code>destroy</code> - Replaces all blocks (including air) in the fill region with the specified block, dropping the existing blocks (including those that are unchanged) and block contents as entities as if they had been mined with an unenchanted diamond [[shovel]] or [[pickaxe]]. (Blocks that can only be mined with [[shear]]s, such as [[vines]], will not drop; neither will liquids.) ::* <code>hollow</code> - Replaces only blocks on the outer edge of the fill region with the specified block. Inner blocks are changed to air, dropping their contents as entities but not themselves. If the fill region has no inner blocks (because it is smaller than three blocks in at least one dimension), acts like <code>replace</code>. ::* <code>keep</code> - Replaces only air blocks in the fill region with the specified block. ::* <code>outline</code> - Replaces only blocks on the outer edge of the fill region with the specified block. Inner blocks are not affected. If the fill region has no inner blocks (because it is smaller than three blocks in at least one dimension), acts like <code>replace</code>. ::* <code>replace</code> - Replaces all blocks (including air) in the fill region with the specified block, without dropping blocks or block contents as entities. Optionally, instead of specifying a data tag for the replacing block, block id and data values may be specified to limit which blocks are replaced (see ''replaceTileName'' and ''replaceDataValue'' below) ::If not specified, defaults to <code>replace</code>. : ''dataTag'' (optional) :: Specifies the data tag to use for the fill block (for example, contents of a chest, patterns on a banner, etc.). Must be a compound [[NBT tag]] (for example, <code>{CustomName:Fred}</code>). Cannot be combined with the ''replaceTileName'' and ''replaceDataValue'' arguments. : ''replaceTileName replaceDataValue'' (optional) :: Arguments are only valid when ''oldBlockHandling'' is <code>replace</code>. Cannot be combined with the ''dataTag'' argument. ::Specifies the [[Data values#Block ID|block id and data]] of the blocks in the fill region to be replaced. If ''replaceDataValue'' is not specified, data value is ignored when determining which blocks to replace. If both arguments are not specified, replaces all blocks in the fill region. ;Result : Fails if the arguments are not specified correctly, if the fill region is not rendered, if the block volume of the fill region is greater than 32768, if ''dataValue'' or ''dataTag'' are invalid for the specified block id, or if no blocks were changed. : On success, changes blocks in the fill region to the specified block. ;Examples : <code>/fill <span style="background-color:#FDD">52 63 -1516</span> <span style="background-color:#DDF">33 73 -1536</span> minecraft:gold_block 0 replace minecraft:stained_hardened_clay 1</code> :: Replaces all the orange stained hardened clay in the selected area with gold blocks. : <code>/fill <span style="background-color:#FDD">~-3 ~-3 ~-3</span> <span style="background-color:#DDF">~3 ~-1 ~3</span> minecraft:water 0</code> :: Replaces with water the blocks in a 7x7x3 cube directly beneath the player. : <code>/fill <span style="background-color:#FDD">~-3 ~ ~-4</span> <span style="background-color:#DDF">~3 ~4 ~4</span> minecraft:planks 2 hollow</code> :: Creates a house-sized box around the player and replaces with air any blocks that would have been inside the box. <!-- 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