Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
L_glandieres authored and L_glandieres committed Feb 27, 2025
1 parent fe42909 commit d444a08
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions docs/modules/block.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Fill all or part of a region with a specific block.
- {nbt}`string` {nbt}`list` **from**: Starting position as a valid position string or a list of 3 elements (x, y, z).
- {nbt}`string` {nbt}`list` **to**: Ending position as a valid position string or a list of 3 elements (x, y, z).
- {nbt}`string` **mode**: Mode used to set blocks [destroy|keep|replace] (default: replace).
- {nbt}`string` **on_finished**: Command executed at the end of the operation (at the location of the final block).
- {nbt}`int` **limit**: Limit how many blocks can be set in a single tick (default: 4096).
- {nbt}`list` **masks**: Determine which blocks will be replaced.
- {nbt}`compound` Block mask
Expand All @@ -55,11 +56,11 @@ Fill all or part of a region with a specific block.
**State**: Blocks are placed in the world.
```

*Replace the top layer of dirt by grass:*
*Replace the top layer of dirt by grass and use a say command when finished:*

```mcfunction
# Setup the input
data modify storage bs:in block.fill_block set value {block:"minecraft:grass_block",from:[-16,100,0],to:[-1,103,15],masks:[{block:"minecraft:dirt"},{block:"minecraft:air",y:1}]}
data modify storage bs:in block.fill_block set value {block:"minecraft:grass_block",from:[-16,100,0],to:[-1,103,15],on_finished:"say added grass on top",masks:[{block:"minecraft:dirt"},{block:"minecraft:air",y:1}]}
# Run the process
function #bs.block:fill_block
Expand Down Expand Up @@ -89,6 +90,7 @@ Fill all or part of a region with a specific block type, preserving states and N
- {nbt}`string` {nbt}`list` **from**: Starting position as a valid position string or a list of 3 elements (x, y, z).
- {nbt}`string` {nbt}`list` **to**: Ending position as a valid position string or a list of 3 elements (x, y, z).
- {nbt}`string` **mode**: Mode used to set blocks [destroy|keep|replace] (default: replace).
- {nbt}`string` **on_finished**: Command executed at the end of the operation (at the location of the final block).
- {nbt}`int` **limit**: Limit how many blocks can be set in a single tick (default: 4096).
- {nbt}`list` **masks**: Determine which blocks will be replaced.
- {nbt}`compound` Block mask
Expand All @@ -103,11 +105,11 @@ Fill all or part of a region with a specific block type, preserving states and N
**State**: Blocks are placed in the world.
```

*Replace oak stairs with spruce stairs while preserving states:*
*Replace oak stairs with spruce stairs while preserving states and use a say command when finished:*

```mcfunction
# Setup the input
data modify storage bs:in block.fill_type set value {type:"minecraft:spruce_stairs",from:[-16,100,0],to:[-1,103,15],masks:[{block:"minecraft:oak_stairs"}]}
data modify storage bs:in block.fill_type set value {type:"minecraft:spruce_stairs",from:[-16,100,0],to:[-1,103,15],on_finished:"say replaced the stairs",masks:[{block:"minecraft:oak_stairs"}]}
# Run the process
function #bs.block:fill_type
Expand All @@ -130,6 +132,7 @@ Fill all or part of a region with random blocks or types.
- {nbt}`string` {nbt}`list` **from**: Starting position as a valid position string or a list of 3 elements (x, y, z).
- {nbt}`string` {nbt}`list` **to**: Ending position as a valid position string or a list of 3 elements (x, y, z).
- {nbt}`string` **mode**: Mode used to set blocks [destroy|keep|replace] (default: replace).
- {nbt}`string` **on_finished**: Command executed at the end of the operation (at the location of the final block).
- {nbt}`int` **limit**: Limit how many blocks can be set in a single tick (default: 4096).
- {nbt}`list` **masks**: Determine which blocks will be replaced.
- {nbt}`compound` Block mask
Expand All @@ -144,11 +147,11 @@ Fill all or part of a region with random blocks or types.
**State**: Blocks are placed in the world.
```

*Randomly fill an area with stone or air:*
*Randomly fill an area with stone or air and use a say command when finished:*

```mcfunction
# Setup the input
data modify storage bs:in block.fill_random set value {entries:[{block:"minecraft:stone"},{block:"minecraft:air"}],from:[-16,100,0],to:[-1,103,15]}
data modify storage bs:in block.fill_random set value {entries:[{block:"minecraft:stone"},{block:"minecraft:air"}],from:[-16,100,0],to:[-1,103,15],on_finished:"say randomly placed stone"}
# Run the process
function #bs.block:fill_random
Expand Down

0 comments on commit d444a08

Please sign in to comment.