3 The WorldEdit API is composed of multiple modules, each of which is independent and can be used without the other. Each module is contained within a single file.
\r
5 For more information, see the [README](README.md).
\r
9 Contained in manipulations.lua, this module allows several node operations to be applied over a region.
\r
11 ### worldedit.volume(pos1, pos2)
\r
13 Determines the volume of the region defined by positions `pos1` and `pos2`.
\r
17 ### worldedit.set(pos1, pos2, nodename)
\r
19 Sets a region defined by positions `pos1` and `pos2` to `nodename`. To clear to region, use "air" as the value of `nodename`.
\r
21 Returns the number of nodes set.
\r
23 ### worldedit.replace(pos1, pos2, searchnode, replacenode)
\r
25 Replaces all instances of `searchnode` with `replacenode` in a region defined by positions `pos1` and `pos2`.
\r
27 Returns the number of nodes replaced.
\r
29 Returns the number of nodes added.
\r
31 ### worldedit.copy(pos1, pos2, axis, amount)
\r
33 Copies the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") by `amount` nodes.
\r
35 Returns the number of nodes copied.
\r
37 ### worldedit.move(pos1, pos2, axis, amount)
\r
39 Moves the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") by `amount` nodes.
\r
41 Returns the number of nodes moved.
\r
43 ### worldedit.stack(pos1, pos2, axis, count)
\r
45 Duplicates the region defined by positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z") `count` times.
\r
47 Returns the number of nodes stacked.
\r
49 ### worldedit.transpose(pos1, pos2, axis1, axis2)
\r
51 Transposes a region defined by the positions `pos1` and `pos2` between the `axis1` and `axis2` axes ("x" or "y" or "z").
\r
53 Returns the number of nodes transposed.
\r
55 ### worldedit.flip(pos1, pos2, axis)
\r
57 Flips a region defined by the positions `pos1` and `pos2` along the `axis` axis ("x" or "y" or "z").
\r
59 Returns the number of nodes flipped.
\r
61 ### worldedit.rotate(pos1, pos2, angle)
\r
63 Rotates a region defined by the positions `pos1` and `pos2` by `angle` degrees clockwise around the y axis (supporting 90 degree increments only).
\r
65 Returns the number of nodes rotated.
\r
67 ### worldedit.dig(pos1, pos2)
\r
69 Digs a region defined by positions `pos1` and `pos2`.
\r
71 Returns the number of nodes dug.
\r
75 Contained in primitives.lua, this module allows the creation of several geometric primitives.
\r
77 ### worldedit.hollow_sphere = function(pos, radius, nodename)
\r
79 Adds a hollow sphere at `pos` with radius `radius`, composed of `nodename`.
\r
81 Returns the number of nodes added.
\r
83 ### worldedit.sphere = function(pos, radius, nodename)
\r
85 Adds a sphere at `pos` with radius `radius`, composed of `nodename`.
\r
87 Returns the number of nodes added.
\r
89 ### worldedit.hollow_cylinder(pos, axis, length, radius, nodename)
\r
91 Adds a hollow cylinder at `pos` along the `axis` axis ("x" or "y" or "z") with length `length` and radius `radius`, composed of `nodename`.
\r
93 Returns the number of nodes added.
\r
95 ### worldedit.cylinder(pos, axis, length, radius, nodename)
\r
97 Adds a cylinder at `pos` along the `axis` axis ("x" or "y" or "z") with length `length` and radius `radius`, composed of `nodename`.
\r
99 Returns the number of nodes added.
\r
101 ### worldedit.pyramid(pos, height, nodename)
\r
103 Adds a pyramid at `pos` with height `height`.
\r
105 Returns the number of nodes added.
\r
107 ### worldedit.spiral(pos, width, height, spacer, nodename)
\r
109 Adds a spiral at `pos` with width `width`, height `height`, space between walls `spacer`, composed of `nodename`.
\r
113 Contained in visualization.lua, this module allows nodes to be visualized in different ways.
\r
115 ### worldedit.hide(pos1, pos2)
\r
117 Hides all nodes in a region defined by positions `pos1` and `pos2` by non-destructively replacing them with invisible nodes.
\r
119 Returns the number of nodes hidden.
\r
121 ### worldedit.suppress(pos1, pos2, nodename)
\r
123 Suppresses all instances of `nodename` in a region defined by positions `pos1` and `pos2` by non-destructively replacing them with invisible nodes.
\r
125 Returns the number of nodes suppressed.
\r
127 ### worldedit.find(pos1, pos2, nodename)
\r
129 Finds all instances of `nodename` in a region defined by positions `pos1` and `pos2` by non-destructively hiding all other nodes.
\r
131 Returns the number of nodes found.
\r
133 ### worldedit.restore(pos1, pos2)
\r
135 Restores all nodes hidden with WorldEdit functions in a region defined by positions `pos1` and `pos2`.
\r
137 Returns the number of nodes restored.
\r
141 Contained in serialization.lua, this module allows regions of nodes to be serialized and deserialized to formats suitable for use outside MineTest.
\r
143 ### worldedit.serialize(pos1, pos2)
\r
145 Converts the region defined by positions `pos1` and `pos2` into a single string.
\r
147 Returns the serialized data and the number of nodes serialized.
\r
149 ### worldedit.deserialize(originpos, value)
\r
151 Loads the nodes represented by string `value` at position `originpos`.
\r
153 Returns the number of nodes deserialized.
\r
155 ### worldedit.deserialize_old(originpos, value)
\r
157 Loads the nodes represented by string `value` at position `originpos`, using the older table-based WorldEdit format.
\r
159 This function is deprecated, and should not be used unless there is a need to support legacy WorldEdit save files.
\r
161 Returns the number of nodes deserialized.
\r
163 ### worldedit.metasave(pos1, pos2, file)
\r
165 Saves the nodes and meta defined by positions `pos1` and `pos2` into a file.
\r
167 Returns the number of nodes saved.
\r
169 ### worldedit.metaload(pos1, file)
\r
171 Loads the nodes and meta from `file` to position `pos1`.
\r
173 Returns the number of nodes loaded.