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