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

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.

Tip

Here’s a video detailing some of these patterns which were added in WorldEdit 7: https://www.youtube.com/watch?v=S5wCVMf3SvM

Single Block Pattern

The most basic pattern of just a single block. A block is identified by three parts: the block type, additional block states, and `nbt data<https://minecraft.wiki/w/NBT_format>`_. These three 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. NBT is written using Minecraft’s SNBT syntax, block_type{'nbt_key':'value'}. NBT data always comes after the block states if supplied, block_type[property=value]{'nbt_key':'value'}.

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>.

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.

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].

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).

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.

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 "".

Player Heads

You can set the skin of a player head by specifying a username after the pipe symbol.

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.