From 1ef08a080a29f4cc9bf52a20a112766fc7f1a9ea Mon Sep 17 00:00:00 2001
From: rubenwardy If you have any difficulty in understanding this, please read
Programming in Lua.
This page was last updated 07/December/2015.
See doc/lua_api.txt for the latest version (in plaintext).
Generated using a Python script.Programming in Lua
+This page was last updated 19/March/2016.
See doc/lua_api.txt for the latest version (in plaintext).
Generated using a Python script.Programming in Lua
Startup
@@ -552,16 +556,16 @@ texture is overlaid over cobble.png
.
Example:
default_cobble.png^[crack:10:1
-[combine:<w>x<h>:<x1>,<y1>=<file1>:<x2>,<y2>=<file2>
[combine:<w>x<h>:<x1>,<y1>=<file1>:<x2>,<y2>=<file2>:...
<w>
= width<h>
= height<x1>
/<x2>
= x positions<y1>
/<y1>
= y positions<file1>
/<file2>
= textures to combine<x>
= x position<y>
= y position<file>
= texture to combineCreate a texture of size <w>
times <h>
and blit <file1>
to (<x1>
,<y1>
)
-and blit <file2>
to (<x2>
,<y2>
).
Creates a texture of size <w>
times <h>
and blits the listed files to their
+specified coordinates.
Example:
[combine:16x32:0,0=default_cobble.png:0,16=default_wood.png
@@ -896,6 +900,18 @@ changed in the future.
wall_bottom = box,
wall_side = box
}
+{
+ -- A node that has optional boxes depending on neighbouring nodes'
+ -- presence and type. See also `connects_to`.
+ type = "connected",
+ fixed = box OR {box1, box2, ...}
+ connect_top = box OR {box1, box2, ...}
+ connect_bottom = box OR {box1, box2, ...}
+ connect_front = box OR {box1, box2, ...}
+ connect_left = box OR {box1, box2, ...}
+ connect_back = box OR {box1, box2, ...}
+ connect_right = box OR {box1, box2, ...}
+}
A box
is defined as:
{x1, y1, z1, x2, y2, z2}
@@ -1613,7 +1629,7 @@ list[current_player;craftpreview;7,1;1,1;]
pwdfield[<X>,<Y>;<W>,<H>;<name>;<label>]
- Textual password style field; will be sent to server when a button is clicked
-- #
x
and y
position the field relative to the top left of the menu
+- #
x
and y
position the field relative to the top left of the menu
- #
w
and h
are the size of the field
- #fields are a set height, but will be vertically centred on
h
- Position and size units are inventory slots
@@ -1623,7 +1639,7 @@ list[current_player;craftpreview;7,1;1,1;]
field[<X>,<Y>;<W>,<H>;<name>;<label>;<default>]
- Textual field; will be sent to server when a button is clicked
-- #
x
and y
position the field relative to the top left of the menu
+- #
x
and y
position the field relative to the top left of the menu
- #
w
and h
are the size of the field
- #fields are a set height, but will be vertically centred on
h
- Position and size units are inventory slots
@@ -1649,34 +1665,34 @@ list[current_player;craftpreview;7,1;1,1;]
label[<X>,<Y>;<label>]
-- #
x
and y
work as per field
+- #
x
and y
work as per field
- #
label
is the text on the label
- Position and size units are inventory slots
vertlabel[<X>,<Y>;<label>]
- Textual label drawn vertically
-- #
x
and y
work as per field
+- #
x
and y
work as per field
- #
label
is the text on the label
- Position and size units are inventory slots
button[<X>,<Y>;<W>,<H>;<name>;<label>]
- Clickable button. When clicked, fields will be sent.
-- #
x
, y
and name
work as per field
+- #
x
, y
and name
work as per field
- #
w
and h
are the size of the button
- #
label
is the text on the button
- Position and size units are inventory slots
image_button[<X>,<Y>;<W>,<H>;<texture name>;<name>;<label>]
-- #
x
, y
, w
, h
, and name
work as per button
+- #
x
, y
, w
, h
, and name
work as per button
- #
texture name
is the filename of an image
- Position and size units are inventory slots
image_button[<X>,<Y>;<W>,<H>;<texture name>;<name>;<label>;<noclip>;<drawborder>;<pressed texture name>]
-- #
x
, y
, w
, h
, and name
work as per button
+- #
x
, y
, w
, h
, and name
work as per button
- #
texture name
is the filename of an image
- Position and size units are inventory slots
- #
noclip=true
means the image button doesn't need to be within specified formsize
@@ -1685,7 +1701,7 @@ list[current_player;craftpreview;7,1;1,1;]
item_image_button[<X>,<Y>;<W>,<H>;<item name>;<name>;<label>]
-- #
x
, y
, w
, h
, name
and label
work as per button
+- #
x
, y
, w
, h
, name
and label
work as per button
- #
item name
is the registered name of an item/node,
tooltip will be made out of its description
to override it use tooltip element
@@ -1702,7 +1718,7 @@ list[current_player;craftpreview;7,1;1,1;]
textlist[<X>,<Y>;<W>,<H>;<name>;<listelem 1>,<listelem 2>,...,<listelem n>]
- Scrollable item list showing arbitrary text elements
-- #
x
and y
position the itemlist relative to the top left of the menu
+- #
x
and y
position the itemlist relative to the top left of the menu
- #
w
and h
are the size of the itemlist
- #
name
fieldname sent to server on doubleclick value is current selected element
- #
listelements
can be prepended by #color in hexadecimal format RRGGBB (only),
@@ -1713,7 +1729,7 @@ list[current_player;craftpreview;7,1;1,1;]
textlist[<X>,<Y>;<W>,<H>;<name>;<listelem 1>,<listelem 2>,...,<listelem n>;<selected idx>;<transparent>]
- Scrollable itemlist showing arbitrary text elements
-- #
x
and y
position the item list relative to the top left of the menu
+- #
x
and y
position the item list relative to the top left of the menu
- #
w
and h
are the size of the item list
- #
name
fieldname sent to server on doubleclick value is current selected element
- #
listelements
can be prepended by #RRGGBB (only) in hexadecimal format
@@ -1727,7 +1743,7 @@ list[current_player;craftpreview;7,1;1,1;]
tabheader[<X>,<Y>;<name>;<caption 1>,<caption 2>,...,<caption n>;<current_tab>;<transparent>;<draw_border>]
- show a tabheader at specific position (ignores formsize)
-- #
x
and y
position the itemlist relative to the top left of the menu
+- #
x
and y
position the itemlist relative to the top left of the menu
- #
name
fieldname data is transferred to Lua
- #
caption 1
...: name shown on top of tab
- #
current_tab
: index of selected tab 1...
@@ -1737,7 +1753,7 @@ list[current_player;craftpreview;7,1;1,1;]
box[<X>,<Y>;<W>,<H>;<color>]
- simple colored semitransparent box
-- #
x
and y
position the box relative to the top left of the menu
+- #
x
and y
position the box relative to the top left of the menu
- #
w
and h
are the size of box
- #
color
is color specified as a ColorString
@@ -1749,7 +1765,7 @@ list[current_player;craftpreview;7,1;1,1;]
- read the value on pressing a button (all dropdown values are available)
-- #
x
and y
position of dropdown
+- #
x
and y
position of dropdown
- width of dropdown
- fieldname data is transferred to Lua
- items to be shown in dropdown
@@ -1758,7 +1774,7 @@ list[current_player;craftpreview;7,1;1,1;]
checkbox[<X>,<Y>;<name>;<label>;<selected>;<tooltip>]
- show a checkbox
-- #
x
and y
: position of checkbox
+- #
x
and y
: position of checkbox
- #
name
fieldname data is transferred to Lua
- #
label
to be shown left of checkbox
- #
selected
(optional): true
/false
@@ -1772,7 +1788,7 @@ list[current_player;craftpreview;7,1;1,1;]
- read the value on pressing a button (all scrollbars are available)
-- #
x
and y
: position of trackbar
+- #
x
and y
: position of trackbar
- #
w
and h
: width and height
- #
orientation
: vertical
/horizontal
- fieldname data is transferred to Lua
@@ -1783,7 +1799,7 @@ list[current_player;craftpreview;7,1;1,1;]
- #show scrollable table using options defined by the previous
tableoptions[]
- #displays cells as defined by the previous
tablecolumns[]
-- #
x
and y
: position the itemlist relative to the top left of the menu
+- #
x
and y
: position the itemlist relative to the top left of the menu
- #
w
and h
are the size of the itemlist
- #
name
: fieldname sent to server on row select or doubleclick
- #
cell 1
...cell n
: cell contents given in row-major order
@@ -1825,7 +1841,7 @@ list[current_player;craftpreview;7,1;1,1;]
- #types:
text
, image
, color
, indent
, tree
- #
text
: show cell contents as text
- #
image
: cell contents are an image index, use column options to define images
-- #
colo
: cell contents are a ColorString and define color of following cell
+- #
color
: cell contents are a ColorString and define color of following cell
- #
indent
: cell contents are a number and define indentation of following cell
- #
tree
: same as indent, but user can open and close subtrees (treeview-like)
@@ -1852,7 +1868,7 @@ list[current_player;craftpreview;7,1;1,1;]
non-numeric cells are treated as 0
.
-- #
color
column options:
+- #
color
column options:
- #
span=<value>
: number of following columns to affect (default: infinite)
@@ -1889,19 +1905,16 @@ or string form, a ColorString (defined above):
colorspec = "green"
Spatial Vectors
-- #
-
vector.new([x[, y, z]])
: returns a vector.
-
-- #
x
is a table or the x
position.
+- #
vector.new(a, b, c)
: returns a vector:
-- #
-
vector.direction(p1, p2)
: returns a vector
-
+- #
vector.direction(p1, p2)
: returns a vector
- #
vector.distance(p1, p2)
: returns a number
- #
vector.length(v)
: returns a number
- #
vector.normalize(v)
: returns a vector
-- #
vector.round(v)
: returns a vector
+- #
vector.round(v)
: returns a vector, each dimension rounded to floor
- #
vector.apply(v, func)
: returns a vector
- #
vector.equals(v1, v2)
: returns a boolean
@@ -1943,8 +1956,9 @@ or string form, a ColorString (defined above):
- #e.g.
string.trim("\n \t\tfoo bar\t ") == "foo bar"
-- #
minetest.pos_to_string({x=X,y=Y,z=Z})
: returns "(X,Y,Z)"
-- Convert position to a printable string
+- #
minetest.pos_to_string({x=X,y=Y,z=Z}, decimal_places))
: returns "(X,Y,Z)"
+- Convert position to a printable string
+ Optional: 'decimal_places' will round the x, y and z of the pos to the given decimal place.
- #
minetest.string_to_pos(string)
: returns a position
@@ -1964,7 +1978,7 @@ or string form, a ColorString (defined above):
- #
minetest.get_us_time()
-- returns time with microsecond precision
+- returns time with microsecond precision. May not return wall time.
- #
table.copy(table)
: returns a table
@@ -2049,6 +2063,7 @@ or string form, a ColorString (defined above):
- #
minetest.register_entity(name, prototype table)
- #
minetest.register_abm(abm definition)
+- #
minetest.register_lbm(lbm definition)
- #
minetest.register_node(name, node definition)
- #
minetest.register_tool(name, item definition)
- #
minetest.register_craftitem(name, item definition)
@@ -2290,11 +2305,13 @@ and minetest.auth_reload
call the authetification handler.
- #
minetest.get_node(pos)
- #
minetest.get_node_or_nil(pos)
- #
minetest.get_node_light(pos, timeofday)
@@ -2358,6 +2375,10 @@ and minetest.auth_reload
call the authetification handler.
- #
minetest.get_timeofday()
- #
minetest.get_gametime()
: returns the time, in seconds, since the world was created
+- #
minetest.get_day_count()
: returns number days elapsed since world was created,
+- accounting for time changes.
+
+
- #
minetest.find_node_near(pos, radius, nodenames)
: returns pos or nil
-- #
minetest.clear_objects()
-- clear all objects in the environments
+- #
minetest.clear_objects([options])
+- Clear all objects in the environment
+- #Takes an optional table as an argument with the field
mode
.
+
- #
minetest.emerge_area(pos1, pos2, [callback], [param])
@@ -2596,7 +2623,7 @@ and minetest.auth_reload
call the authetification handler.
- #
minetest.dir_to_facedir(dir, is6d)
@@ -2608,6 +2635,10 @@ and minetest.auth_reload
call the authetification handler.
- #Convert a vector to a wallmounted value, used for
paramtype2="wallmounted"
+- #
minetest.wallmounted_to_dir(wallmounted)
+- Convert a wallmounted value back into a vector aimed directly out the "back" of a node
+
+
- #
minetest.get_node_drops(nodename, toolname)
- Returns list of item names.
- Note: This will be removed or modified in a future version.
@@ -2636,7 +2667,7 @@ and minetest.auth_reload
call the authetification handler.
- #
minetest.get_all_craft_recipes(query item)
: returns a table or nil
-- #returns indexed table with all registered recipes for query item (node)
+
- #returns indexed table with all registered recipes for query item (node)
or
nil
if no recipe was found
- recipe entry table:
{
@@ -2735,7 +2766,7 @@ and
minetest.auth_reload
call the authetification handler.
Timing
- #
minetest.after(time, func, ...)
@@ -2804,7 +2835,7 @@ and minetest.auth_reload
call the authetification handler.
- #Slice probability works in the same manner, except takes a field
called
ypos
instead which
indicates the y position of the slice with a probability applied.
-- #If slice probability list equals
nil
, no slice probabilities are applied.
+- #If slice probability list equals
nil
, no slice probabilities are applied.
@@ -2850,6 +2881,35 @@ and minetest.auth_reload
call the authetification handler.
+HTTP Requests:
+
+- #
minetest.request_http_api()
:
+- #returns
HTTPApiTable
containing http functions if the calling mod has been granted
+ access by being listed in the secure.http_mods
or secure.trusted_mods
setting,
+ otherwise returns nil
.
+- #The returned table contains the functions
fetch
, fetch_async
and fetch_async_get
+ described below.
+- Only works at init time and must be called from the mod's main scope (not from a function).
+- Function only exists if minetest server was built with cURL support.
+- DO NOT ALLOW ANY OTHER MODS TO ACCESS THE RETURNED TABLE, STORE IT IN
+ A LOCAL VARIABLE!
+
+
+- #
HTTPApiTable.fetch(HTTPRequest req, callback)
+- Performs given request asynchronously and calls callback upon completion
+- #callback:
function(HTTPRequestResult res)
+- Use this HTTP function if you are unsure, the others are for advanced use.
+
+
+- #
HTTPApiTable.fetch_async(HTTPRequest req)
: returns handle
+- #Performs given request asynchronously and returns handle for
minetest.http_fetch_async_get
+
+
+- #
HTTPApiTable.fetch_async_get(handle)
: returns HTTPRequestResult
+- Return response data for given asynchronous HTTP request
+
+
+
Misc.
- #
minetest.get_connected_players()
: returns list of ObjectRefs
@@ -2887,7 +2947,7 @@ and minetest.auth_reload
call the authetification handler.
- Convert a string containing JSON data into the Lua equivalent
- #
nullvalue
: returned in place of the JSON null; defaults to nil
- #On success returns a table, a string, a number, a boolean or
nullvalue
-- #On failure outputs an error message and returns
nil
+- #On failure outputs an error message and returns
nil
- #Example:
parse_json("[10, {\"a\":false}]")
, returns {10, {a = false}}
@@ -2905,7 +2965,7 @@ and minetest.auth_reload
call the authetification handler.
- #
minetest.serialize(table)
: returns a string
-- #Convert a table containing tables, strings, numbers, booleans and
nil
s
+ - #Convert a table containing tables, strings, numbers, booleans and
nil
s
into string form readable by minetest.deserialize
- #Example:
serialize({foo='bar'})
, returns 'return { ["foo"] = "bar" }'
@@ -3007,7 +3067,7 @@ end
insecure functions if the calling mod has been listed as trusted in the
secure.trusted_mods
setting or security is disabled, otherwise returns nil
.
-- Only works at init time.
+- Only works at init time and must be called from the mod's main scope (not from a function).
- DO NOT ALLOW ANY OTHER MODS TO ACCESS THE RETURNED ENVIRONMENT, STORE IT IN
A LOCAL VARIABLE!
@@ -3063,6 +3123,10 @@ end
- List of registered ore definitions.
+#minetest.registered_biomes
+- List of registered biome definitions.
+
+
#minetest.registered_decorations
- List of registered decoration definitions.
@@ -3169,6 +3233,23 @@ Can be gotten via minetest.get_node_timer(pos)
.
#set_properties(object property table)
#get_properties()
: returns object property table
#is_player()
: returns true for players, false otherwise
+#get_nametag_attributes()
+- returns a table with the attributes of the nametag of an object
+- {
+ color = {a=0..255, r=0..255, g=0..255, b=0..255},
+ text = "",
+ }
+
+
+#set_nametag_attributes(attributes)
+- sets the attributes of the nametag of an object
+- #
attributes
:
+ {
+ color = ColorSpec,
+ text = "My Nametag",
+ }
+
+
LuaEntitySAO-only (no-op for other objects)
@@ -3244,7 +3325,7 @@ Can be gotten via minetest.get_node_timer(pos)
.
- #
hud_set_flags(flags)
: sets specified HUD flags to true
/false
- #
flags
: (is visible) hotbar
, healthbar
, crosshair
, wielditem
, minimap
- #pass a table containing a
true
/false
value of each flag to be set or unset
-- #if a flag equals
nil
, the flag is not modified
+- #if a flag equals
nil
, the flag is not modified
- #note that setting
minimap
modifies the client's permission to view the minimap -
- the client may locally elect to not view the minimap
@@ -3282,14 +3363,12 @@ Can be gotten via minetest.get_node_timer(pos)
.
- #
"plain"
: Uses 0 textures, bgcolor
used
-#Note: currently does not work directly in on_joinplayer
; use
- minetest.after(0)
in there.
#get_sky()
: returns bgcolor, type and a table with the textures
#override_day_night_ratio(ratio or nil)
#get_day_night_ratio()
: returns the ratio or nil if it isn't overridden
@@ -3308,17 +3387,6 @@ Can be gotten via minetest.get_node_timer(pos)
.
in first person view
#in third person view (max. values {x=-10/10,y=-10,15,z=-5/5}
)
#get_eye_offset()
: returns offset_first and offset_third
-#get_nametag_attributes()
-returns a table with the attributes of the nametag of the player
-{
- color = {a=0..255, r=0..255, g=0..255, b=0..255},
- }
-#set_nametag_attributes(attributes)
-sets the attributes of the nametag of the player
-#attributes
:
- {
- color = ColorSpec,
- }
@@ -3365,8 +3433,7 @@ If you chose the parameter-less constructor, a fast implementation will be autom
#get_area(id, include_borders, include_data)
: returns the area with the id id
. (optional) Boolean values include_borders
and include_data
control what's copied.
#get_areas_for_pos(pos, include_borders, include_data)
: returns all areas that contain the position pos
. (optional) Boolean values include_borders
and include_data
control what's copied.
#get_areas_in_area(edge1, edge2, accept_overlap, include_borders, include_data)
: returns all areas that contain all nodes inside the area specified by edge1
and edge2
(inclusive). If accept_overlap
is true, also areas are returned that have nodes in common with the specified area. (optional) Boolean values include_borders
and include_data
control what's copied.
-#insert_area(edge1, edge2, data)
: inserts an area into the store. Returns the id if successful, nil otherwise. The (inclusive) positions edge1
and edge2
describe the area, data
-is a string stored with the area.
+#insert_area(edge1, edge2, data, [id])
: inserts an area into the store. Returns the new area's ID, or nil if the insertion failed. The (inclusive) positions edge1
and edge2
describe the area. data
is a string stored with the area. If passed, id
will be used as the internal area ID, it must be a unique number between 0 and 2^32-2. If you use the id
parameter you must always use it, or insertions are likely to fail due to conflicts.
#reserve(count)
: reserves resources for at most count
many contained areas. Only needed for efficiency, and only some implementations profit.
#remove_area(id)
: removes the area with the given id from the store, returns success.
#set_cache_params(params)
: sets params for the included prefiltering cache. Calling invalidates the cache, so that its elements have to be newly generated.
@@ -3378,6 +3445,10 @@ is a string stored with the area.
}
+#to_string()
: Experimental. Returns area store serialized as a (binary) string.
+#to_file(filename)
: Experimental. Like to_string()
, but writes the data to a file.
+#from_string(str)
: Experimental. Deserializes string and loads it into the AreaStore. Returns success and, optionally, an error message.
+#from_file(filename)
: Experimental. Like from_string()
, but reads the data from a file.
ItemStack
An ItemStack
is a stack of items.
@@ -3401,7 +3472,7 @@ an itemstring, a table or nil
.
#item
can also be an itemstring or table.
-#to_string()
: Returns the stack in itemstring form.
+#to_string()
: Returns the stack in itemstring form.
#to_table()
: Returns the stack in Lua table form.
#get_stack_max()
: Returns the maximum size of the stack (depends on the item).
#get_free_space()
: Returns get_stack_max() - get_count()
.
@@ -3835,7 +3906,7 @@ numeric unique decoration ID.
#B
: replace with rules set B
#C
: replace with rules set C
#D
: replace with rules set D
-#a
: replace with rules set A, chance 90%
+#a
: replace with rules set A, chance 90%
#b
: replace with rules set B, chance 80%
#c
: replace with rules set C, chance 70%
#d
: replace with rules set D, chance 60%
@@ -3888,7 +3959,12 @@ minetest.spawn_tree(pos,apple_tree)
stepheight = 0,
automatic_face_movement_dir = 0.0,
-- ^ automatically set yaw to movement direction; offset in degrees; false to disable
+ automatic_face_movement_max_rotation_per_sec = -1,
+-- ^ limit automatic rotation to this value in degrees per second. values < 0 no limit
backface_culling = true, -- false to disable backface_culling for model
+ nametag = "", -- by default empty, for players their name is shown if empty
+ nametag_color = <color>, -- sets color of nametag as ColorSpec
+ infotext = "", -- by default empty, text to be shown when pointed at object
}
register_entity
)register_lbm
){
+ name = "modname:replace_legacy_door",
+ nodenames = {"default:lava_source"},
+-- ^ List of node names to trigger the LBM on.
+-- Also non-registered nodes will work.
+-- Groups (as of group:groupname) will work as well.
+ run_at_every_load = false,
+-- ^ Whether to run the LBM's action every time a block gets loaded,
+-- and not just for blocks that were saved last time before LBMs were
+-- introduced to the world.
+ action = func(pos, node),
+}
+
register_node
, register_craftitem
, register_tool
){
description = "Steel Axe",
@@ -4003,7 +4093,7 @@ minetest.spawn_tree(pos,apple_tree)
#{name="image.png", animation={Tile Animation definition}}
#{name="image.png", backface_culling=bool, tileable_vertical=bool,
tileable_horizontal=bool}
-- backface culling only supported in special tiles.
+- backface culling enabled by default for most nodes
- tileable flags are info for shaders, how they should treat texture
when displacement mapping is used
Directions are from the point of view of the tile texture,
@@ -4049,6 +4139,7 @@ minetest.spawn_tree(pos,apple_tree)
diggable = true, -- If false, can never be dug
climbable = false, -- If true, can be climbed on (ladder)
buildable_to = false, -- If true, placed nodes can replace this node
+ floodable = false, -- If true, liquids flow into and replace this node
liquidtype = "none", -- "none"/"source"/"flowing"
liquid_alternative_flowing = "", -- Flowing version of source liquid
liquid_alternative_source = "", -- Source version of flowing liquid
@@ -4062,6 +4153,12 @@ minetest.spawn_tree(pos,apple_tree)
light_source = 0, -- Amount of light emitted by node
damage_per_second = 0, -- If player is inside node, this damage is caused
node_box = {type="regular"}, -- See "Node boxes"
+ connects_to = nodenames, --[[
+ * Used for nodebox nodes with the type == "connected"
+ * Specifies to what neighboring nodes connections will be drawn
+ * e.g. `{"group:fence", "default:wood"}` or `"default:stone"` ]]
+ connect_sides = { "top", "bottom", "front", "left", "back", "right" }, --[[
+ ^ Tells connected nodebox nodes to connect only to these sides of this node. ]]
mesh = "model",
selection_box = {type="regular"}, -- See "Node boxes" --[[
^ If drawtype "nodebox" is used and selection_box is nil, then node_box is used. ]]
@@ -4312,11 +4409,12 @@ minetest.spawn_tree(pos,apple_tree)
-- ^ Minimum and maximum `y` positions these decorations can be generated at.
-- ^ This parameter refers to the `y` position of the decoration base, so
-- the actual maximum height would be `height_max + size.Y`.
- flags = "liquid_surface",
+ flags = "liquid_surface, force_placement",
-- ^ Flags for all decoration types.
-- ^ "liquid_surface": Instead of placement on the highest solid surface
-- ^ in a mapchunk column, placement is on the highest liquid surface.
-- ^ Placement is disabled if solid nodes are found above the liquid surface.
+-- ^ "force_placement": Nodes other than "air" and "ignore" are replaced by the decoration.
----- Simple-type parameters
decoration = "default:grass",
@@ -4360,7 +4458,7 @@ minetest.spawn_tree(pos,apple_tree)
},
-- ^ See 'Schematic specifier' for details.
replacements = {["oldname"] = "convert_to", ...},
- flags = "place_center_x, place_center_y, place_center_z, force_placement",
+ flags = "place_center_x, place_center_y, place_center_z",
-- ^ Flags for schematic decorations. See 'Schematic attributes'.
rotation = "90" -- rotate schematic 90 degrees on placement
-- ^ Rotation can be "0", "90", "180", "270", or "random".
@@ -4466,4 +4564,36 @@ minetest.spawn_tree(pos,apple_tree)
playername = "singleplayer"
-- ^ Playername is optional, if specified spawns particle only on the player's client
}
+
+HTTPRequest
definition (http_fetch
, http_fetch_async
){
+ url = "http://example.org",
+ timeout = 10,
+ -- ^ Timeout for connection in seconds. Default is 3 seconds.
+ post_data = "Raw POST request data string" OR { field1 = "data1", field2 = "data2" },
+ -- ^ Optional, if specified a POST request with post_data is performed.
+ -- ^ Accepts both a string and a table. If a table is specified, encodes table
+ -- ^ as x-www-form-urlencoded key-value pairs.
+ -- ^ If post_data ist not specified, a GET request is performed instead.
+ user_agent = "ExampleUserAgent",
+ -- ^ Optional, if specified replaces the default minetest user agent with given string
+ extra_headers = { "Accept-Language: en-us", "Accept-Charset: utf-8" },
+ -- ^ Optional, if specified adds additional headers to the HTTP request. You must make sure
+ -- ^ that the header strings follow HTTP specification ("Key: Value").
+ multipart = boolean
+ -- ^ Optional, if true performs a multipart HTTP request. Default is false.
+}
+
+HTTPRequestResult
definition (http_fetch
callback, http_fetch_async_get
){
+ completed = true,
+ -- ^ If true, the request has finished (either succeeded, failed or timed out)
+ succeeded = true,
+ -- ^ If true, the request was succesful
+ timeout = false,
+ -- ^ If true, the request timed out
+ code = 200,
+ -- ^ HTTP status code
+ data = "response"
+}
\ No newline at end of file