WorldEdit, Generation Commands (//generate)
Master the worldedit generate command for creating spheres, cylinders, tori, and custom math-based shapes. Includes expression syntax, examples, and performance tips.
What //generate Does
The worldedit generate command creates shapes from mathematical expressions. Unlike //sphere or //cyl which produce fixed shapes, //generate (or //gen, //g) evaluates a formula for every block in your selection and places blocks wherever the expression returns true. This lets you build tori, sine waves, terrain noise, and any shape you can express mathematically.
Before using generation commands, make sure WorldEdit is properly installed using our WorldEdit setup guide.
Basic Syntax
//generate <pattern> <expression>
The expression uses variables x, y, and z which represent normalized coordinates from -1 to 1 across your selection. The command places blocks wherever the expression evaluates to a value greater than 0.
Your First Generation: A Sphere
Select a region with //pos1 and //pos2 (or //wand), then run:
//generate stone x^2+y^2+z^2<1
This creates a sphere of stone. The expression x^2+y^2+z^2<1 is the equation of a unit sphere. Every block whose normalized coordinates satisfy that inequality gets filled. The selection dimensions determine the sphere's proportions, a cubic selection gives a perfect sphere, a rectangular one gives an ellipsoid.
Common Shape Expressions
Torus (Donut)
//generate stone (sqrt(x^2+z^2)-0.5)^2+y^2<0.1
This produces a torus with a major radius of 0.5 and a tube thickness controlled by the 0.1 threshold. Adjust 0.5 to change the donut's size and 0.1 to change the tube's thickness. This makes tori trivial, something that would take hours to build by hand.
Cylinder
//generate stone x^2+z^2<0.5
Creates a vertical cylinder. The Y axis is unconstrained, so the cylinder fills the full height of your selection.
Cone
//generate stone x^2+z^2<(1-y)^2*0.25
The radius shrinks as Y increases, forming a cone. Flip the expression to (1+y)^2 for an inverted cone.
Sine Wave Terrain
//generate grass_block y
Generates rolling hills by combining two sine waves at different frequencies. Multiply the frequency values to control hill spacing, and adjust the amplitude multipliers (0.3 and 0.2) to control height variation.
Hollow Shapes
To make any shape hollow, use the -h flag:
//generate -h glass x^2+y^2+z^2<1
This creates a hollow glass sphere, only the outer shell is placed. The -h variant is perfect for domes, bubbles, and architectural features.
Using Patterns with //generate
You can use weighted patterns just like any other WorldEdit command:
//generate 60%stone,30%cobblestone,10%andesite x^2+y^2+z^2<1
This creates a sphere with randomized block types, giving it a natural stone appearance instead of uniform material.
Expression Variables and Functions
The expression engine supports standard math functions:
sin(),cos(),tan()for trigonometric shapessqrt()for distance calculationsabs()for absolute valuemin(),max()for clampingrandom()for noise (returns 0 to 1)^for exponents
Combine these to build complex geometry. For example, adding random()*0.1 to a sphere expression creates a rough, asteroid-like surface.
Performance Tips
Generation commands process every block in your selection. A 100x100x100 selection evaluates one million expressions. Keep these guidelines in mind:
- Start with small selections to test your expression, then scale up
- Use
//undoliberally, generation mistakes are expensive - On production servers, limit selection sizes through WorldEdit's config to prevent lag
- Complex expressions with multiple
sin()andsqrt()calls are slower per block
If you need to generate shapes across very large areas, consider using FAWE for async processing. Be aware of the world format considerations described in our WorldEdit guides.
Practical Example: Arena Dome
Build a glass dome over a PvP arena. Select the arena area with generous vertical space, then:
//generate glass x^2+y^2+z^2<1&&x^2+y^2+z^2>0.95&&y>0
This creates the top half (y>0) of a hollow sphere shell (between radius 0.95 and 1.0). The result is a thin glass dome that covers the arena while leaving the floor open. The worldedit generate command turns what would be an hour of hand-building into a single line.
Summary
The worldedit generate command unlocks mathematical shape creation that goes far beyond the built-in geometry tools. Start with simple expressions like spheres and cylinders, then combine trigonometric functions and noise for organic results. Always test on small selections first, and use the -h flag for hollow variants.
Full config access on every plan: Astroworld Hosting, NVMe SSDs, Pterodactyl panel.