diff options
Diffstat (limited to 'WorldEdit API.md')
-rw-r--r-- | WorldEdit API.md | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/WorldEdit API.md b/WorldEdit API.md index a0a1a60..0b383ed 100644 --- a/WorldEdit API.md +++ b/WorldEdit API.md @@ -182,4 +182,20 @@ Returns the number of nodes saved. Loads the nodes and meta from `file` to position `pos1`.
-Returns the number of nodes loaded.
\ No newline at end of file +Returns the number of nodes loaded.
+
+Code
+----
+Contained in code.lua, this module allows arbitrary Lua code to be used with WorldEdit.
+
+### error = worldedit.lua(code)
+
+Executes `code` as a Lua chunk in the global namespace.
+
+Returns an error if the code fails or nil otherwise.
+
+### error = worldedit.luatransform(pos1, pos2, code)
+
+Executes `code` as a Lua chunk in the global namespace with the variable pos available, for each node in a region defined by positions `pos1` and `pos2`.
+
+Returns an error if the code fails or nil otherwise.
\ No newline at end of file |