Minecraft World Edit How to Make a Line
Patterns¶
You may have noticed (or if you haven't yet, you soon will) that many WorldEdit commands take a "pattern" as a parameter. Patterns range from very simple (such as a single block - stone
) to very complex. Patterns determine what blocks get set into the world as a command, tool, etc operates.
- Available Patterns
- Single Block Pattern
- Random Pattern
- Random State Pattern
- Clipboard Pattern
- Type or State Applying Pattern
- Block Category Pattern
- Special Block Data Syntax
- Sign Text
- Player Heads
- Mob Spawners
Available Patterns¶
Note
This list may be incomplete as patterns are added to WorldEdit. In addition, our API allows other plugins to register new patterns, which will not be listed here.
Single Block Pattern¶
The most basic pattern of just a single block. A block is identified by two parts: the block type, and additional block states. These two links to the Minecraft Wiki, along with WorldEdit's in-built tab-completion for commands, should guide you in specifying the block you want. Additional states are always appended to the type using the syntax block_type[state1=value,state2=value,...]
. Note that when states are not specified, or if some are left out, the default values will be used for those states.
Example: Single block patterns
Setting a selection to stone:
Setting a selection to a note block with a specific instrument and pitch:
//set note_block[instrument=chime,note=18]
Setting a selection to an oak stair block facing east with the bigger part on top:
//set oak_stairs[facing=east,half=top]
Random Pattern¶
This pattern allows setting random blocks from any number of other patterns. The basic form is as simple as a comma-separated list of patterns, which will be chosen from evenly. You can also specify weights for each pattern with <x>%<pattern>
.
Example:: Random Patterns
Setting a selection to different types of stone, equally distributed:
//set stone,diorite,andesite,granite
Setting a selection to mostly red wool, with a small amount of glass (5:1 ratio, see note below):
//set 50%red_wool,10%red_stained_glass
Note
Despite the percentage sign, weights need not add up to 100. They are cumulative and will be divided by the total. That is, 5%dirt,15%stone
means 25% of blocks will be dirt, and 75% will be stone. In other words, weights are relative to each other, not to 100. Because of that, the pattern 5%dirt
isn't valid. If you only want to set 5% of blocks to dirt, you should use the random noise mask.
Tip
You can use any other pattern as one of the choices, not just the single block pattern. Keep reading to see more patterns…
Random State Pattern¶
Prefixing any block type with an asterisk ( *
) will randomly choose between all states for that block for each position.
Example: Random State Pattern
Setting oak logs facing in random directions:
Clipboard Pattern¶
The #clipboard
pattern will take blocks from your clipboard in the same arrangement. This makes it easy to build one part of a repeating complicated pattern by hand, and then repeat it over and over. You can also offset the pattern by adding @[x,y,z]
.
Example: Using the clipboard pattern
Replacing all existing blocks to your clipboard:
//replace #existing #clipboard
Using the clipboard in the first image to replace a hill. Note the repeating layers.
Using an offset to align the clipboard:
Type or State Applying Pattern¶
This pattern, prefixed by ^
, lets you set the type or states of a block without modifying everything else. This pattern will, for example, allow you to change a spiral staircase from oak to acacia without having to worry about the stairs facing in different directions and so on. You can either specify a block type (to change block type but not states, where applicable), or any number of states (to only change those states, where applicable).
Example: Type/State Applying Patterns
Replacing all oak stairs to acacia stairs, while maintaining orientation, etc:
//replace oak_stairs ^acacia_stairs
Removing the water from all waterloggable blocks:
//set ^[waterlogged=false]
Doubling up all slabs:
//replace ##slabs ^[type=double]
Block Category Pattern¶
This pattern allows setting random blocks within a block category, often referred to as a "tag". Tags allow grouping blocks together under a single name. Minecraft comes with many tags inbuilt (see the link) and also allows creating and modifying tags via data packs. You may already have noticed these tags being used as a mask in the example above ( ##slabs
).
The syntax for this pattern is ##<tag name>
, which will randomly choose between the default state of all blocks in the category. You can also mix this with the random state pattern ( ##*<tag name>
) to use all states, not just the defaults.
Example: Block Category Pattern Usage
Replacing all existing blocks with rainbow wool:
//replace #existing ##wool
Setting the selection to random types of slabs, both top/bottom/double, and waterlogged at random:
Special Block Data Syntax¶
Some blocks have additional syntax for setting extra information.
Sign Text¶
You can set text on signs by separating it with a pipe symbol ( |
). Note that if the text has spaces, you must wrap the entire pattern in quotes ""
.
Example: Setting sign text
Simple Example:
//set oak_sign|Line1|Line2
With spaces and rotation:
//set "oak_wall_sign[facing=north]|Hello world|Second|Third line"
Player Heads¶
You can set the skin of a player head by specifying a username after the pipe symbol.
Example: Setting a skin on a head
//set player_head|dinnerbone
Mob Spawners¶
You can set the type of mob to be spawned (again via the pipe symbol). Note that the name of the mob must be an entity ID. Prefixing minecraft: is optional, modded mobs must have a namespace.
Example: Creating a squid spawner
Minecraft World Edit How to Make a Line
Source: https://worldedit.enginehub.org/en/latest/usage/general/patterns/
0 Response to "Minecraft World Edit How to Make a Line"
Post a Comment