Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/fill: Difference between revisions

From SAS Gaming Wiki
imported>Felunka
Update the name of the game rule used to control the max numbers of blocks that can be modified by the fill command
 
SyncBot (talk | contribs)
Remove broken links to missing pages
Line 4: Line 4:
* 2 {{only|java|short=1}}
* 2 {{only|java|short=1}}
* 1 {{only|bedrock|short=1}}
* 1 {{only|bedrock|short=1}}
|others=[[Minecraft:Cheat]] only{{only|bedrock|short=1}}
|others=Cheat only{{only|bedrock|short=1}}
}}
}}


Line 35: Line 35:


{{el|be|short=1}}: {{argument|be=1|blockStates: block states|BlockStateCommandParam}}
{{el|be|short=1}}: {{argument|be=1|blockStates: block states|BlockStateCommandParam}}
: Specifies the [[Minecraft:block states]] to use for the block.
: Specifies the block states to use for the block.
: {{Arg desc|be=BlockStateCommandParam}}
: {{Arg desc|be=BlockStateCommandParam}}


Line 41: Line 41:
{{el|be|short=1}}: {{argument|be=1|oldBlockHandling: FillMode|enum}}
{{el|be|short=1}}: {{argument|be=1|oldBlockHandling: FillMode|enum}}
: Specifies the handling of the block changes. Must be one of the following:
: Specifies the handling of the block changes. Must be one of the following:
:* <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 [[Minecraft:shovel]] or [[Minecraft:pickaxe]]. (Blocks that can be mined only with [[Minecraft:shear]]s, such as [[Minecraft:vines]], do not drop; neither do liquids.)
:* <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 [[Minecraft:shovel]] or [[Minecraft:pickaxe]]. (Blocks that can be mined only with shears, such as [[Minecraft:vines]], do not drop; neither do liquids.)
:* <code>hollow</code> - Replaces only the 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>hollow</code> - Replaces only the 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 the air blocks in the fill region with the specified block.
:* <code>keep</code> - Replaces only the air blocks in the fill region with the specified block.
Line 54: Line 54:


{{el|be|short=1}}: {{argument|be=1|replaceBlockStates: block states|BlockStateCommandParam}}
{{el|be|short=1}}: {{argument|be=1|replaceBlockStates: block states|BlockStateCommandParam}}
: Specifies the [[Minecraft:block states]] to use for the block to be replaced.
: Specifies the block states to use for the block to be replaced.
: {{Arg desc|be=BlockStateCommandParam}}
: {{Arg desc|be=BlockStateCommandParam}}


Line 101: Line 101:
|{{HistoryLine|java}}
|{{HistoryLine|java}}
|{{HistoryLine||1.8|dev=14w03a|Added {{cmd|fill|link=none}}.}}
|{{HistoryLine||1.8|dev=14w03a|Added {{cmd|fill|link=none}}.}}
|{{HistoryLine||1.11|dev=16w32a|Added [[Minecraft:block state]] support to {{cmd|fill|link=none}}.}}
|{{HistoryLine||1.11|dev=16w32a|Added block state support to {{cmd|fill|link=none}}.}}
|{{HistoryLine||1.19.4|dev=23w03a|Now the limit volume of the fill region is controlled by <code>commandModificationBlockLimit</code> gamerule, instead of a hardcoded value 32768.}}
|{{HistoryLine||1.19.4|dev=23w03a|Now the limit volume of the fill region is controlled by <code>commandModificationBlockLimit</code> gamerule, instead of a hardcoded value 32768.}}
|{{HistoryLine||1.21.5|dev=25w02a|The behavior of {{cmd|fill}} command has changed in how it handles block entity data.|The replace option in the fill command is no longer terminal, and can be followed with additional options.|Accepts a new option: <code>strict</code>.|New syntax for commands to use the new strict option, and more flexible use of replace.}}
|{{HistoryLine||1.21.5|dev=25w02a|The behavior of {{cmd|fill}} command has changed in how it handles block entity data.|The replace option in the fill command is no longer terminal, and can be followed with additional options.|Accepts a new option: <code>strict</code>.|New syntax for commands to use the new strict option, and more flexible use of replace.}}
|{{HistoryLine||1.21.11|dev=25w44a|All [[Minecraft:game rules]] have now been moved into a registry. Therefore <code>commandModificationBlockLimit</code> has been renamed to <code>max_block_modifications</code>.}}}}
|{{HistoryLine||1.21.11|dev=25w44a|All game rules have now been moved into a registry. Therefore <code>commandModificationBlockLimit</code> has been renamed to <code>max_block_modifications</code>.}}}}


=== ''Bedrock Edition'' ===
=== ''Bedrock Edition'' ===
Line 111: Line 111:
|{{HistoryLine||v0.16.0|dev=build 1|Added {{cmd|fill|link=none}}.}}
|{{HistoryLine||v0.16.0|dev=build 1|Added {{cmd|fill|link=none}}.}}
|{{HistoryLine|bedrock}}
|{{HistoryLine|bedrock}}
|{{HistoryLine||1.16.210|dev=beta 1.16.210.53|Added [[Minecraft:block state]] support to {{cmd|fill|link=none}}.}}
|{{HistoryLine||1.16.210|dev=beta 1.16.210.53|Added block state support to {{cmd|fill|link=none}}.}}
|{{HistoryLine||1.19.70|dev=Preview 1.19.70.21|Removed <code>tileData: int</code> and <code>replaceDataValue: int</code> arguments.}}
|{{HistoryLine||1.19.70|dev=Preview 1.19.70.21|Removed <code>tileData: int</code> and <code>replaceDataValue: int</code> arguments.}}
}}
}}
Line 122: Line 122:
{{Navbox commands}}
{{Navbox commands}}


[[Minecraft:de:Befehl/fill]]
de:Befehl/fill
[[Minecraft:es:Comandos/fill]]
es:Comandos/fill
[[Minecraft:fr:Commandes/fill]]
fr:Commandes/fill
[[Minecraft:ja:コマンド/fill]]
ja:コマンド/fill
[[Minecraft:ko:명령어/fill]]
ko:명령어/fill
[[Minecraft:pt:Comandos/fill]]
pt:Comandos/fill
[[Minecraft:ru:Команды консоли/fill]]
ru:Команды консоли/fill
[[Minecraft:uk:Команди консолі/fill]]
uk:Команди консолі/fill
[[Minecraft:zh:命令/fill]]
zh:命令/fill

Revision as of 15:44, 9 April 2026

Template:Infobox command

Fills all or parts of a region with a specific Minecraft:block.

Syntax

  • Java Edition
fill <from> <to> <block> [outline|hollow|destroy|strict|replace|keep]
fill <from> <to> <block> replace <filter> [outline|hollow|destroy|strict]
  • Bedrock Edition
fill <from: x y z> <to: x y z> <tileName: Block> <blockStates: block states> [oldBlockHandling: FillMode]
fill <from: x y z> <to: x y z> <tileName: Block> [oldBlockHandling: FillMode]
The fill command also has an optional alternate syntax for replace mode:
fill <from: x y z> <to: x y z> <tileName: Block> <blockStates: block states> replace [replaceTileName: Block] [replaceBlockStates: block states]
fill <from: x y z> <to: x y z> <tileName: Block> replace [replaceTileName: Block] [replaceBlockStates: block states]

Arguments

Template:El: Template:Argument and Template:Argument
Template:El: Template:Argument and Template:Argument

Specifies any two opposing corner blocks of the region to be filled (the "fill region").
Template:Arg desc
Block position is the coordinates of the point at the lower northwest corner of a block. Because of this, the lesser coordinates of each axis are on the region boundary, but the greater coordinates are one block from the boundary, and the block volume of the source region is (xgreater - xlesser + 1) × (ygreater - ylesser + 1) × (zgreater - zlesser + 1). For example, 0 0 0 0 0 0 has a 1-block volume, and 0 0 0 1 1 1 and 1 1 1 0 0 0 both identify the same region with an 8-block volume.

Template:Argument

Specifies the block to fill the region with.
Template:Arg desc

Template:El: Template:Argument

Specifies the block states to use for the block.
Template:Arg desc

Template:El: Template:Cd
Template:El: Template:Argument

Specifies the handling of the block changes. Must be one of the following:
  • destroy - 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 Minecraft:shovel or Minecraft:pickaxe. (Blocks that can be mined only with shears, such as Minecraft:vines, do not drop; neither do liquids.)
  • hollow - Replaces only the 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 replace.
  • keep - Replaces only the air blocks in the fill region with the specified block.
  • outline - Replaces only the 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 replace.
  • replace - Replaces all blocks (including air) in the fill region with the specified block, without dropping blocks or block contents as entities. Optionally, block ID and data values may be specified to limit which blocks are replaced.
  • strict - Place blocks as-is without triggering block updates and shape updates.
If not specified, defaults to replace.

Template:Argument

Specifies the ID of the blocks in the fill region to be replaced. If not specified, replaces all blocks in the fill region.
Template:Arg desc

Template:El: Template:Argument

Specifies the block states to use for the block to be replaced.
Template:Arg desc

Result

Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table

Output

Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table

Examples

  • /fill 52 63 -1516 33 73 -1536 minecraft:gold_block replace minecraft:orange_glazed_terracottaTemplate:Only
  • /fill 52 63 -1516 33 73 -1536 gold_block [] replace orange_glazed_terracottaTemplate:Only
    • Replaces all the orange glazed terracotta in the selected area with gold blocks.
  • /fill ~-3 ~-3 ~-3 ~3 ~-1 ~3 water
    • Replaces the blocks in a 7×3×7 region directly beneath the command execution's location with water.
  • /fill ~-3 ~ ~-4 ~3 ~4 ~4 stone hollowTemplate:Only
  • /fill ~-3 ~ ~-4 ~3 ~4 ~4 stone 0 hollowTemplate:Only
    • Creates a house-sized box around the command execution's location, replacing any blocks that would have been inside the box with air.
  • /fill ~-15 ~-15 ~-15 ~15 ~15 ~15 stone
    • Creates a solid cube of stone centered on the command execution's location.
  • /fill ~-1 ~ ~ ~1 ~ ~ minecraft:prismarine_brick_stairs[facing=south,waterlogged=true]
    • Replaces the specific blocks around the command execution's location with waterlogged prismarine brick stairs facing south.

History

Template:Expand section

Java Edition

Template:HistoryTable

Bedrock Edition

Template:HistoryTable

External links

Navigation

Template:Navbox commands

de:Befehl/fill es:Comandos/fill fr:Commandes/fill ja:コマンド/fill ko:명령어/fill pt:Comandos/fill ru:Команды консоли/fill uk:Команди консолі/fill zh:命令/fill