### Install Dependencies and Run Dev Server Source: https://github.com/enginehub/worldeditdocs/blob/master/README.md Use this command to install project dependencies and then run the development server for auto-rebuilding documentation. ```bash pip install -r requirements.txt # Now you can run ./dev.py to auto-rebuild the docs into build/dirhtml, and browse it at the printed address. ``` -------------------------------- ### CraftScripts Installation and Usage Source: https://context7.com/enginehub/worldeditdocs/llms.txt Instructions for installing CraftScripts by placing the js.jar and .js files in the correct WorldEdit directories, and commands to run scripts. ```plaintext # Installation: # 1. Download rhino-runtime-1.7.13.jar → rename to js.jar # 2. Place js.jar in plugins/WorldEdit/ (Bukkit) or mods/ (other) # 3. Drop .js scripts into config/worldedit/craftscripts/ # Run a script /cs myscript arg1 arg2 /.s arg1 arg2 # re-run the last script ``` -------------------------------- ### Install WorldEdit JAR Source: https://context7.com/enginehub/worldeditdocs/llms.txt Place the WorldEdit JAR file in the appropriate plugins or mods folder for your Minecraft server or client setup. ```bash # Bukkit / Spigot / Paper server/ └── plugins/ └── WorldEdit-7.4.jar ← place here, then start server # NeoForge / Fabric (single-player or server) .minecraft/ └── mods/ └── worldedit-mod-7.4.jar server/ ← dedicated server └── mods/ └── worldedit-mod-7.4.jar # Verify installation in-game /worldedit version # Output: WorldEdit version 7.4.x-... ``` -------------------------------- ### Example: Creating Cylinders and Circles Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/generation.rst Demonstrates creating a filled glass cylinder and a hollow elliptical stone cylinder. The first example uses a single radius and height, while the second uses two radii for an elliptical shape. ```plaintext //cyl glass 5 10 ``` ```plaintext //hcyl stone 5.5,15 1 ``` -------------------------------- ### WorldEdit Gradle Dependency Setup Source: https://context7.com/enginehub/worldeditdocs/llms.txt Gradle configuration for adding WorldEdit core and platform-specific dependencies to your project. ```groovy // build.gradle repositories { maven { url "https://maven.enginehub.org/repo/" } } dependencies { // Core API (no platform dependency) compileOnly "com.sk89q.worldedit:worldedit-core:7.4.0" // Bukkit platform (adds BukkitAdapter conversion helpers) compileOnly "com.sk89q.worldedit:worldedit-bukkit:7.4.0" // Or for Fabric (replace mc1201 with your MC version tag) // compileOnly "com.sk89q.worldedit:worldedit-fabric-mc1201:7.4.0" } ``` -------------------------------- ### Selection Information Commands Source: https://context7.com/enginehub/worldeditdocs/llms.txt Get details about your current selection, including size, block counts, and distributions. ```plaintext //size # dimensions and block count of selection //count stone # count matching blocks inside selection //distr # block-type distribution report //distr -d # separate by block states ``` -------------------------------- ### Create Edit Session for World Source: https://github.com/enginehub/worldeditdocs/blob/master/source/api/concepts/edit-sessions.rst Get an edit session for a specific WorldEdit World. This is a basic way to start an editing session. ```java WorldEdit.getInstance().newEditSession(world) ``` -------------------------------- ### Simple for loop syntax Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/other/expressions.rst Use this syntax for basic iteration where a counter increments by 1.0 each step. The start and end expressions are evaluated only once. ```plaintext for ( = , ) ``` -------------------------------- ### Setting a Block with CraftScript Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/other/craftscripts.rst This example demonstrates how to set a block to white wool at the player's current location using the EditSession. Ensure the BlockTypes package is imported. ```javascript importPackage(Packages.com.sk89q.worldedit.world.block); var sess = context.remember(); sess.setBlock(player.getBlockOn().toVector().toBlockPoint(), BlockTypes.WHITE_WOOL.getDefaultState()); ``` -------------------------------- ### Get Player's Clipboard Source: https://github.com/enginehub/worldeditdocs/blob/master/source/api/examples/local-sessions.rst Retrieve the player's current clipboard from their LocalSession. Throws an EmptyClipboardException if the clipboard is empty. ```java LocalSession localSession = ...; // get a LocalSession as per the first example ClipboardHolder clipboard; // declare variable try { clipboard = localSession.getClipboard(); } catch (EmptyClipboardException ex) { actor.printError(TextComponent.of("Your clipboard is empty.")) return; } /* you can now paste the clipboard somewhere, save it to a schematic, etc. */ // bonus example: applying rotation to the player's clipboard AffineTransform transform = new AffineTransform(); clipboard.setTransform(clipboard.getTransform().combine(transform.rotateY(90))); ``` -------------------------------- ### Get Selection Size Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/regions/selections.rst Retrieves the area and dimensions of the current selection. Use the '-c' flag to measure clipboard size instead. ```plaintext //size [-c] ``` -------------------------------- ### Get BlockState with Properties Source: https://github.com/enginehub/worldeditdocs/blob/master/source/api/concepts/blocks.rst Retrieve a specific BlockState by providing property mappings to the BlockType. Ensure the BlockType is not null. ```java BlockType oakLog = Objects.requireNonNull(BlockTypes.OAK_LOG); BlockState yFacingOakLog = oakLog.getState(ImmutableMap.of( oakLog.getProperty("axis"), "y" )); System.err.println("State: " + yFacingOakLog); ``` -------------------------------- ### EditSession - Setting and Reading Blocks Source: https://context7.com/enginehub/worldeditdocs/llms.txt Demonstrates how to create an EditSession, place blocks, and read block information. The try-with-resources statement ensures the session is automatically flushed and changes are tracked for undo. ```APIDOC ## EditSession – Setting and Reading Blocks `EditSession` is the central API object. All block edits flow through it and are automatically tracked for undo. ```java import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.bukkit.BukkitAdapter; // Obtain the WorldEdit world wrapper from a Bukkit world com.sk89q.worldedit.world.World weWorld = BukkitAdapter.adapt(bukkitWorld); // Use try-with-resources so the session flushes automatically on close try (EditSession editSession = WorldEdit.getInstance().newEditSession(weWorld)) { BlockVector3 pos = BlockVector3.at(100, 64, 200); // Place a block editSession.setBlock(pos, BlockTypes.DIAMOND_BLOCK.getDefaultState()); // Read a block var block = editSession.getBlock(pos); System.out.println("Block at pos: " + block.getBlockType().getId()); // Changes are flushed to the world when the try block exits. // The EditSession now holds the undo history for these changes. } // To undo later: try (EditSession undoSession = WorldEdit.getInstance().newEditSession(weWorld)) { editSession.undo(undoSession); } ``` ``` -------------------------------- ### Running a CraftScript Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/other/craftscripts.rst Use the /cs command to execute a CraftScript by its filename. The /.s command re-runs the last executed script. ```text /cs /.s ``` -------------------------------- ### Build Walls and Outlines Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/regions/regionops.rst Use `//faces ` (or `//outline`) for cuboid selections to fill all 6 faces. For any selection type, `//walls ` creates a hollow shell without a ceiling and floor. ```plaintext //faces ``` ```plaintext //walls ``` -------------------------------- ### Load Schematic to Clipboard Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/clipboard.rst Loads a schematic file into the current clipboard. ```plaintext //schem load ``` -------------------------------- ### Loading a Clipboard from a Schematic File Source: https://github.com/enginehub/worldeditdocs/blob/master/source/api/examples/clipboard.rst Use ClipboardFormats.findByFile to discover the format of a schematic file, then use ClipboardReader to load its contents into a Clipboard instance. ```java Clipboard clipboard; ClipboardFormat format = ClipboardFormats.findByFile(file); try (ClipboardReader reader = format.getReader(new FileInputStream(file))) { clipboard = reader.read(); } /* use the clipboard here */ ``` -------------------------------- ### Getting the WorldEdit Wand Source: https://github.com/enginehub/worldeditdocs/blob/master/source/quickstart.rst Obtain the wooden axe, also known as the WorldEdit wand, which is essential for making selections. ```plaintext //wand ``` -------------------------------- ### Get LocalSession for an Actor Source: https://github.com/enginehub/worldeditdocs/blob/master/source/api/examples/local-sessions.rst Obtain a LocalSession for a given actor. The actor is typically obtained by adapting a platform-specific entity. ```java org.bukkit.entity.Player player = ...; // platform-specific player class, generally obtained from a command, event, etc. Player actor = BukkitAdapter.adapt(player); // WorldEdit's native Player class extends Actor SessionManager manager = WorldEdit.getInstance().getSessionManager(); LocalSession localSession = manager.get(actor); ``` -------------------------------- ### Configuring Sphere Brush Source: https://github.com/enginehub/worldeditdocs/blob/master/source/quickstart.rst Sets up a sphere brush with a specified material and radius. Ensure the active item in your hotbar is the brush type. ```plaintext /br sphere stone 5 ``` -------------------------------- ### Build Faces (Outline) Source: https://github.com/enginehub/worldeditdocs/blob/master/source/commands.rst Constructs the walls, ceiling, and floor of the selection using a specified block pattern. This command effectively creates a hollow shell of the selected region. ```plaintext //faces ``` -------------------------------- ### //faces Source: https://github.com/enginehub/worldeditdocs/blob/master/source/commands.rst Builds the walls, ceiling, and floor of a selection using a specified block pattern. Alias: //outline. ```APIDOC ## //faces ### Description Build the walls, ceiling, and floor of a selection. ### Usage ``` //faces ``` ### Parameters #### Path Parameters - **pattern** (string) - The pattern of blocks to set. ``` -------------------------------- ### Get Player's Selection Region Source: https://github.com/enginehub/worldeditdocs/blob/master/source/api/examples/local-sessions.rst Retrieve the player's current region selection. Throws an IncompleteRegionException if no selection has been made. ```java // get a LocalSession as per the above example LocalSession localSession = ...; Region region; // declare the region variable // note: not necessarily the player's current world, see the concepts page World selectionWorld = localSession.getSelectionWorld(); try { if (selectionWorld == null) throw new IncompleteRegionException(); region = localSession.getSelection(selectionWorld); } catch (IncompleteRegionException ex) { actor.printError(TextComponent.of("Please make a region selection first.")); return; } /* you can now use the region object for edits, check for a specific shape, etc. */ ``` -------------------------------- ### Forest Brush Command Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/tools/brushes.rst Plants trees using specified shape, radius, density, and tree type, analogous to '//forest' and '//forestgen'. ```bash /brush forest [radius] [density] ``` -------------------------------- ### Applying Brush Mask Source: https://github.com/enginehub/worldeditdocs/blob/master/source/quickstart.rst Restricts the brush's effect to only affect blocks matching the specified mask. For example, only affecting grass blocks. ```plaintext /mask grass ``` -------------------------------- ### List Supported Schematic Formats Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/clipboard.rst Displays all the schematic formats that WorldEdit can currently read and write. ```plaintext //schem listformats ``` -------------------------------- ### Fill Area Downwards Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/utilities.rst Fills air blocks with a given pattern starting from the placement position and working downwards. It only fills straight down and does not fill caves. ```plaintext //fill [depth] ``` -------------------------------- ### Gravity Brush Command Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/tools/brushes.rst Moves blocks downwards within the brush area. The -h flag makes it start from the maximum Y instead of the top of the brush area. ```bash /brush gravity [radius] [-h] ``` -------------------------------- ### Teleport and Navigation Commands Source: https://context7.com/enginehub/worldeditdocs/llms.txt Quickly navigate the game world using various teleportation and movement commands. ```bash # Teleport to the block you are looking at /jumpto # Alias: /j (or left-click with navigation wand / compass) # Pass through the wall you are facing /thru # Move up one floor (through any ceiling blocks) /ascend /ascend 3 # ascend 3 floors at once # Move down one floor /descend # Fly to ceiling, placing glass to stand on /ceil /ceil 2 # leave 2 blocks of clearance above # Move up N blocks, placing glass beneath you if airborne /up 5 # Free yourself from being stuck inside a block /unstuck ``` -------------------------------- ### Unstuck from Blocks Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/navigation.rst Use this command to get out of a block if you are embedded inside. It moves you to the top-most free position. The short alias can be useful if you find yourself suffocating after pasting or generating something on top of yourself. ```plaintext /unstuck /! ``` -------------------------------- ### Copying a Region to a Clipboard Source: https://github.com/enginehub/worldeditdocs/blob/master/source/api/examples/clipboard.rst Use ForwardExtentCopy to copy blocks from a region in a world to a clipboard. Configure copying entities before completing the operation. ```java CuboidRegion region = new CuboidRegion(min, max); BlockArrayClipboard clipboard = new BlockArrayClipboard(region); ForwardExtentCopy forwardExtentCopy = new ForwardExtentCopy( world, region, clipboard, region.getMinimumPoint() ); // configure here Operations.complete(forwardExtentCopy); ``` -------------------------------- ### List Available Schematics Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/clipboard.rst Lists all available schematics. Supports sorting by modification time and pagination. The output is interactive for navigation and loading. ```plaintext //schem list [-dn] [-p ] ``` -------------------------------- ### Define Selection Region with Commands Source: https://context7.com/enginehub/worldeditdocs/llms.txt Set selection positions using commands, either to your current location, specific coordinates, or the block you are looking at. ```bash # --- Command method --- //pos1 # set pos 1 to your current location //pos2 # set pos 2 to your current location //pos1 100,64,200 # set pos 1 to specific coordinates //hpos1 # set pos 1 to the block you are looking at ``` -------------------------------- ### Overlay Blocks Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/regions/regionops.rst Use `//overlay ` to place blocks on top of existing non-air blocks within the selection's columns. The top of the selection must be open. ```plaintext //overlay ``` -------------------------------- ### Fill and Face Operations Source: https://context7.com/enginehub/worldeditdocs/llms.txt Fill selections with specific blocks or create hollow structures. Use `//faces` for walls/ceiling/floor and `//walls` for side walls. ```plaintext # Fill the walls, ceiling, and floor (hollow box) //faces glass # Only the four side walls //walls stone_bricks ``` -------------------------------- ### Setting and Reading Blocks with EditSession Source: https://context7.com/enginehub/worldeditdocs/llms.txt Use EditSession to place and retrieve blocks. Changes are automatically tracked for undo and flushed when the session closes. Ensure to use try-with-resources for automatic flushing. ```java import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.bukkit.BukkitAdapter; // Obtain the WorldEdit world wrapper from a Bukkit world com.sk89q.worldedit.world.World weWorld = BukkitAdapter.adapt(bukkitWorld); // Use try-with-resources so the session flushes automatically on close try (EditSession editSession = WorldEdit.getInstance().newEditSession(weWorld)) { BlockVector3 pos = BlockVector3.at(100, 64, 200); // Place a block editSession.setBlock(pos, BlockTypes.DIAMOND_BLOCK.getDefaultState()); // Read a block var block = editSession.getBlock(pos); System.out.println("Block at pos: " + block.getBlockType().getId()); // Changes are flushed to the world when the try block exits. // The EditSession now holds the undo history for these changes. } // To undo later: try (EditSession undoSession = WorldEdit.getInstance().newEditSession(weWorld)) { editSession.undo(undoSession); } ``` -------------------------------- ### Terrain and Flora Generation Commands Source: https://context7.com/enginehub/worldeditdocs/llms.txt Commands for generating forests, scattering flora, and creating terrain using mathematical expressions or predefined features. ```plaintext # Forest within the current selection //forest tree 20 # 20% density oak forest //forest birch 50 ``` ```plaintext # Flora scatter //flora 30 # 30% density ``` ```plaintext # Generate shapes with a mathematical expression # (torus of wool coloured by angle) //generate wool data=(32+15/2/pi*atan2(x,y))%16; (0.75-sqrt(x^2+y^2))^2+z^2<0.25^2 ``` ```plaintext # Hollow donut (only the surface) //generate -h stone (0.75-sqrt(x^2+y^2))^2+z^2<0.25^2 ``` ```plaintext # Place a Minecraft feature (e.g. a desert well) //feature minecraft:desert_well ``` ```plaintext # Set biomes in the selection //setbiome minecraft:jungle //generatebiome minecraft:badlands x^2+z^2<0.5^2 ``` -------------------------------- ### Manage WorldEdit Snapshots Source: https://context7.com/enginehub/worldeditdocs/llms.txt Commands for listing, selecting, and restoring from WorldEdit snapshots. Includes date-based selection and timezone setting. ```plaintext /snapshot list /snapshot list -p 2 # page 2 ``` ```plaintext /snapshot use "world-2024-01-15_03-00" /snapshot sel 3 # use index 3 from /snapshot list ``` ```plaintext /snapshot before "2024-01-15 12:00:00" /snapshot after "2024-01-14 00:00:00" ``` ```plaintext /restore ``` ```plaintext /worldedit tz America/New_York ``` -------------------------------- ### Change Selection Mode to Extend Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/regions/selections.rst Enables 'extend' selection mode. Left-click to set the first point, right-click to extend the cuboid selection to encompass the new point. ```plaintext //sel extend ``` -------------------------------- ### WorldEdit Configuration File Source: https://context7.com/enginehub/worldeditdocs/llms.txt Configure WorldEdit settings such as block limits, wand items, and snapshot directories. The file location varies by platform. ```yaml # plugins/WorldEdit/config.yml (Bukkit) # config/worldedit/worldedit.properties (NeoForge/Fabric) defaultChangeLimit: -1 # -1 = unlimited blocks per operation maxChangeLimit: 100000 # hard cap players can set with //limit maxBrushRadius: 6 # maximum brush radius maxRadius: -1 # -1 = unlimited for sphere/cyl commands wandItem: "minecraft:wooden_axe" navigationWand: "minecraft:compass" navigationWandMaxDistance: 50 saveDir: "schematics" # folder for //schem save / load scriptsDir: "craftscripts" snapshotRepo: "" # path to backup world folder logCommands: false scriptTimeout: 3000 # ms before a CraftScript is killed calculationTimeout: 100 # ms before //generate expression is killed serverSideCUI: true # enable //drawsel visualisation ``` -------------------------------- ### //overlay Source: https://github.com/enginehub/worldeditdocs/blob/master/source/commands.rst Sets a block on top of existing blocks within the region. ```APIDOC ## //overlay ### Description Set a block on top of blocks in the region. ### Usage ``` //overlay ``` ### Parameters #### Path Parameters - **pattern** (string) - The pattern of blocks to overlay. ``` -------------------------------- ### WorldEdit Snapshot Configuration Source: https://context7.com/enginehub/worldeditdocs/llms.txt Configuration snippet for setting the snapshot repository directory. ```yaml snapshotRepo: "/backups/worlds/world" ``` -------------------------------- ### WorldEdit Patterns: Special Cases (Signs, Heads, Spawners) Source: https://context7.com/enginehub/worldeditdocs/llms.txt Place special blocks like signs with text, player heads, or mob spawners using specific pattern syntax. ```plaintext # Special: sign text, player heads, mob spawners //set "oak_wall_sign[facing=north]|Hello world|Second line" //set player_head|dinnerbone //set spawner|squid ``` -------------------------------- ### Set Blocks in Selection Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/regions/regionops.rst Use `//set ` to fill the entire selection with a specified pattern. Supports complex patterns for varied block placement. ```plaintext //set stone ``` ```plaintext //set 30%red_wool,*oak_log,#copy,##slabs ``` -------------------------------- ### Expression Syntax for //generate and //deform Source: https://context7.com/enginehub/worldeditdocs/llms.txt Details the mathematical expression syntax used with WorldEdit commands like `//generate` and `//deform` for creating shapes and modifying terrain based on formulas. ```APIDOC ## Expression Syntax for `//generate` and `//deform` Mathematical expressions are used with `//generate` (shape from formula) and `//deform` (warp existing terrain). Variables `x`, `y`, `z` are normalised coordinates within the selection (range roughly –1 to 1). ``` # Solid sphere //generate stone x^2+y^2+z^2 < 0.5^2 # Torus (donut) of wool, coloured by angle //generate wool (0.75-sqrt(x^2+y^2))^2+z^2<0.25^2 # Sine wave terrain //generate stone y < sin(x*pi)*0.3 # Perlin noise terrain (organic hills) //generate stone y < perlin(0, x, 0, z, 0.5, 4, 0.5)*0.5 # Warp: push blocks outward from centre (inflate sphere) //deform x*=1.2; y*=1.2; z*=1.2 # Warp: create a wave effect //deform y+=sin(x*pi*2)*0.1 # Warp: only below y=0 (lower half of selection) //deform if(y<0) { y+=0.2; } # Expression mask: only affect blocks below sea level (64) //gmask =y<64 //gmask =queryRel(0,-1,0,0,0) # only blocks with air directly below ``` ``` -------------------------------- ### Sphere Brush Command Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/tools/brushes.rst Creates a sphere at the target point. Use the -h flag for a hollow sphere. ```bash /brush sphere [-h] [radius] /br s [-h] [radius] ``` -------------------------------- ### Schematic Management Commands Source: https://context7.com/enginehub/worldeditdocs/llms.txt Commands for saving, loading, listing, deleting, and sharing schematics. Use -f to overwrite existing files. ```plaintext # Save clipboard to disk //schem save my_house //schem save my_house -f # overwrite if file exists ``` ```plaintext # Load a schematic into clipboard //schem load my_house ``` ```plaintext # List saved schematics //schem list //schem list -n # sorted newest-first //schem list -p 2 # page 2 ``` ```plaintext # Delete a schematic //schem delete old_build ``` ```plaintext # Share clipboard online (EngineHub Paste – expires after 1 month) //schem share //schem share my_build enginehub sponge ``` -------------------------------- ### EditSession Builder - Advanced Options Source: https://context7.com/enginehub/worldeditdocs/llms.txt Shows how to use the EditSession builder to configure advanced options such as maximum block changes and inventory consumption. ```APIDOC ## EditSession Builder – Advanced Options ```java import com.sk89q.worldedit.extent.inventory.BlockBag; EditSession editSession = WorldEdit.getInstance() .newEditSessionBuilder() .world(weWorld) .maxBlocks(50_000) // cap block changes .blockBag(null) // optional inventory consumption .build(); ``` ``` -------------------------------- ### //set Source: https://github.com/enginehub/worldeditdocs/blob/master/source/commands.rst Sets all blocks within the selected region to a specified pattern. ```APIDOC ## //set ### Description Sets all the blocks in the region. ### Usage ``` //set ``` ### Parameters #### Path Parameters - **pattern** (string) - The pattern of blocks to set. ``` -------------------------------- ### Replace with Clipboard Pattern Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/general/patterns.rst Replaces existing blocks within a selection using the content from the WorldEdit clipboard. This is useful for repeating complex structures. ```plaintext //replace #existing #clipboard ``` -------------------------------- ### WorldEdit Masks: #existing, #solid, and Offset Masks Source: https://context7.com/enginehub/worldeditdocs/llms.txt Use predefined masks like `#existing` (non-air) or `#solid`. Apply offset masks to affect blocks relative to a pattern. ```plaintext # #existing: any non-air block //replace #existing stone # #solid: any physically solid block /gmask #solid # Offset mask: blocks directly above planks (>planks = overlay) //replace >##planks smooth_stone_slab ``` -------------------------------- ### Block Information Query Tool Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/tools/tools.rst Displays information about the right-clicked block, including coordinates, type, states, and light levels. ```plaintext /tool info ``` -------------------------------- ### Ascend to Ceiling with Clearance Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/navigation.rst This command brings you up to the ceiling of the current room. If you provide no clearance parameter, you will be right up to the ceiling. If you specify a clearance, the space above your head will be larger. A glass block is placed under your feet for support and must be removed manually. ```plaintext /ceil [clearance] ``` -------------------------------- ### History and Session Management Commands Source: https://context7.com/enginehub/worldeditdocs/llms.txt Lists console commands for managing WorldEdit history, including undoing/redoing operations, clearing history, and setting session limits. ```APIDOC ## History and Session Management ``` # Undo the last operation //undo # Undo the last 10 operations //undo 10 # Undo another player's operations (requires extra permission) //undo 3 PlayerName # Redo the most recently undone operation //redo //redo 5 # Clear all history for the current session //clearhistory # Change maximum blocks per operation for this session //limit 10000 //limit -1 # unlimited (requires worldedit.limit.unrestricted) # Change expression evaluation timeout (ms) //timeout 500 # Toggle performance mode (disables some side effects for speed) //perf //perf lighting off # disable specific side effect # Set a global mask that applies to ALL your WorldEdit operations //gmask stone # only affect stone blocks globally //gmask # clear global mask ``` ``` -------------------------------- ### Use Try-with-Resources for Edit Session Source: https://github.com/enginehub/worldeditdocs/blob/master/source/api/concepts/edit-sessions.rst Safely manage an EditSession using a try-with-resources statement, ensuring it is automatically closed and flushed upon exiting the block. ```java try (EditSession editSession = WorldEdit.getInstance().newEditSession(world)) { // use the edit session here ... } // it is automatically closed/flushed when the code exits the block ``` -------------------------------- ### //replace Source: https://github.com/enginehub/worldeditdocs/blob/master/source/commands.rst Replaces all blocks in the selection with another specified pattern. Aliases: //re, //rep. ```APIDOC ## //replace ### Description Replace all blocks in the selection with another. ### Usage ``` //replace [from] ``` ### Parameters #### Path Parameters - **from** (string) - Optional: The mask representing blocks to replace. - **to** (string) - The pattern of blocks to replace with. ``` -------------------------------- ### Brush Binding Commands Source: https://context7.com/enginehub/worldeditdocs/llms.txt Commands to bind various brush tools (sphere, cylinder, smooth, clipboard, gravity, forest, deform, biome, butcher, extinguish) to held items for interactive sculpting. ```plaintext # Sphere brush: place stone spheres of radius 5 /brush sphere stone 5 /br s stone 5 ``` ```plaintext # Hollow sphere brush /brush sphere -h stone 5 ``` ```plaintext # Cylinder brush (radius 4, height 3) /brush cylinder stone 4 3 /br cyl stone 4 3 ``` ```plaintext # Smooth terrain within radius 4, 3 iterations /brush smooth 4 3 ``` ```plaintext # Clipboard brush – stamp your clipboard wherever you right-click //copy # first copy something /brush clipboard /brush clipboard -a # skip air when stamping ``` ```plaintext # Gravity brush – drop blocks downward in radius 3 /brush gravity 3 ``` ```plaintext # Forest brush /brush forest sphere 5 30 oak # 30% density oaks in sphere of radius 5 ``` ```plaintext # Deform brush – raise terrain (y-=1 expression) /brush raise sphere 5 # Lower terrain /brush lower sphere 5 ``` ```plaintext # Biome brush /brush biome sphere 5 minecraft:savanna ``` ```plaintext # Butcher brush – kill mobs in radius 10 /brush butcher 10 /brush butcher 10 -a # also kill animals ``` ```plaintext # Extinguish fire /brush extinguish 5 /br ex 5 ``` ```plaintext # Unbind brush from current item /brush none ``` -------------------------------- ### Set Brush Command Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/tools/brushes.rst Sets spheres, cylinders, or cuboids of a given size and pattern. Primarily useful for creating cubes. ```bash /brush set [size] ``` -------------------------------- ### Expression Syntax for //generate Source: https://context7.com/enginehub/worldeditdocs/llms.txt Use mathematical expressions with `//generate` to create shapes based on formulas. Variables `x`, `y`, `z` represent normalized coordinates within the selection. ```plaintext # Solid sphere //generate stone x^2+y^2+z^2 < 0.5^2 # Torus (donut) of wool, coloured by angle //generate wool (0.75-sqrt(x^2+y^2))^2+z^2<0.25^2 # Sine wave terrain //generate stone y < sin(x*pi)*0.3 # Perlin noise terrain (organic hills) //generate stone y < perlin(0, x, 0, z, 0.5, 4, 0.5)*0.5 ``` -------------------------------- ### Utility Commands for Environment Source: https://context7.com/enginehub/worldeditdocs/llms.txt Commands to fix flowing water and lava to become stationary within a specified radius. ```plaintext # Fix flowing water/lava to become stationary /fixwater 30 /fixlava 30 ``` -------------------------------- ### Apply Type/State Patterns Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/general/patterns.rst Use the '^' prefix to apply block types or states without altering other properties. This is useful for changing block types while preserving orientation or other states. ```worldedit //replace oak_stairs ^acacia_stairs ``` ```worldedit //set ^[waterlogged=false] ``` ```worldedit //replace ##slabs ^[type=double] ``` ```worldedit //replace ##stairs ^##stairs ``` -------------------------------- ### Set Clipboard Pattern Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/general/patterns.rst This pattern uses blocks from the WorldEdit clipboard to fill a selection. An optional offset can be specified to align the clipboard content. ```plaintext //set #clipboard@[2,0,1] ``` -------------------------------- ### //naturalize Source: https://github.com/enginehub/worldeditdocs/blob/master/source/commands.rst Applies a natural terrain layer: 3 layers of dirt on top, then rock below. ```APIDOC ## //naturalize ### Description 3 layers of dirt on top then rock below. ### Usage ``` //naturalize ``` ``` -------------------------------- ### //expand Source: https://github.com/enginehub/worldeditdocs/blob/master/source/commands.rst Expands the current selection by a specified amount or vertically. ```APIDOC ## //expand ### Description Expands the current selection by a specified amount or vertically. ### Usage ``` //expand [reverseAmount] [direction]> ``` ### Parameters #### Path Parameters - **vert** (string) - Expands the selection vertically to world limits. - **amount** (integer) - Amount to expand the selection by. - **reverseAmount** (integer) - Optional: Amount to expand the selection by in the other direction. - **direction** (string) - Optional: Direction to expand. ``` -------------------------------- ### WorldEdit Patterns: Categories, Tags, and Clipboard Source: https://context7.com/enginehub/worldeditdocs/llms.txt Use block categories (tags) or the clipboard content as patterns. Supports positional offsets for clipboard tiling. ```plaintext # Block category / tag (random wool colour) //replace #existing ##wool # Random states from a category (all slab variants incl. waterlogged) //set ##*slabs # Clipboard pattern – tile the clipboard across the region //replace #existing #clipboard //set #clipboard@[2,0,1] # with a positional offset ``` -------------------------------- ### Define Selection Region with Wand Source: https://context7.com/enginehub/worldeditdocs/llms.txt Use the selection wand (wooden axe by default) to define the first and second positions of a cuboid selection region. ```bash # --- Wand method (default: wooden axe) --- //wand # receive the selection wand # LEFT-CLICK a block → position 1 # RIGHT-CLICK a block → position 2 ``` -------------------------------- ### Cylinder Brush Command Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/tools/brushes.rst Creates a cylinder with a specified radius and height. The -h flag makes it hollow. ```bash /brush cylinder [-h] [radius] [height] /br cyl [-h] [radius] [height] ``` -------------------------------- ### Save Clipboard to Schematic Source: https://github.com/enginehub/worldeditdocs/blob/master/source/usage/clipboard.rst Saves the current clipboard to a schematic file. The filename can include subfolders for organization. ```plaintext //schem save ``` -------------------------------- ### Grant WorldEdit Permissions Source: https://context7.com/enginehub/worldeditdocs/llms.txt Manage WorldEdit access using a permissions plugin like LuckPerms or by granting operator status. The root wildcard grants all permissions. ```bash # Grant all WorldEdit permissions to a group /lp group admin permission set worldedit.* true # Or op yourself (Bukkit) /op YourName # Key individual permissions worldedit.wand # use //wand selection tool worldedit.region.set # //set command worldedit.region.replace # //replace command worldedit.clipboard.copy # //copy worldedit.clipboard.paste # //paste worldedit.history.undo # //undo worldedit.history.redo # //redo worldedit.scripting.execute # /cs