^ 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 #colorkey (see colorkeys),
+^ listelements can be prepended by #color in hexadecimal format RRGGBB,
^ if you want a listelement to start with # write ##
textlist[<X>,<Y>;<W>,<H>;<name>;<listelem 1>,<listelem 2>,...,<listelem n>;<selected idx>;<transparent>]
^ simple colored semitransparent box
^ x and y position the box relative to the top left of the menu
^ w and h are the size of box
-^ colorkey (see colorkeys)
+^ color in hexadecimal format RRGGBB
dropdown[<X>,<Y>;<W>;<name>;<item 1>,<item 2>, ...,<item n>;<selected idx>]
^ show a dropdown field
^ Convert position to a printable string
minetest.string_to_pos(string) -> position
^ Same but in reverse
-minetest.formspec_escape(string) -> string
-^ escapes characters like [, ], and \ that can not be used in formspecs
+^ escapes characters [ ] \ , ; that can not be used in formspecs
minetest namespace reference
-----------------------------
Setting-related:
minetest.setting_set(name, value)
minetest.setting_get(name) -> string or nil
+minetest.setting_setbool(name, value)
minetest.setting_getbool(name) -> boolean value or nil
minetest.setting_get_pos(name) -> position or nil
minetest.setting_save() -> nil, save all settings to config file
minetest.get_objects_inside_radius(pos, radius)
minetest.set_timeofday(val): val: 0...1; 0 = midnight, 0.5 = midday
minetest.get_timeofday()
+minetest.get_gametime(): returns the time, in seconds, since the world was created
minetest.find_node_near(pos, radius, nodenames) -> pos or nil
^ nodenames: eg. {"ignore", "group:tree"} or "default:dirt"
minetest.find_nodes_in_area(minp, maxp, nodenames) -> list of positions
^ Gets the internal content ID of name
minetest.get_name_from_content_id(content_id) -> string
^ Gets the name of the content with that content ID
+minetest.parse_json(string[, nullvalue]) -> something
+^ 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
+^ Example: parse_json("[10, {\"a\":false}]") -> {[1] = 10, [2] = {a = false}}
minetest.serialize(table) -> string
^ Convert a table containing tables, strings, numbers, booleans and nils
into string form readable by minetest.deserialize
^ if a flag is nil, the flag is not modified
- hud_set_hotbar_itemcount(count): sets number of items in builtin hotbar
^ count: number of items, must be between 1 and 23
+- hud_set_hotbar_image(texturename)
+ ^ sets background image for hotbar
+- hud_set_hotbar_selected_image(texturename)
+ ^ sets image for selected item of hotbar
InvRef: Reference to an inventory
methods:
makes_footstep_sound = false,
automatic_rotate = false,
stepheight = 0,
+ automatic_face_movement_dir = false,
}
Entity definition (register_entity)
liquid_alternative_flowing = "", -- Flowing version of source liquid
liquid_alternative_source = "", -- Source version of flowing liquid
liquid_viscosity = 0, -- Higher viscosity = slower flow (max. 7)
- liquid_renewable = true, -- Can new liquid source be created by placing
+ liquid_renewable = true, -- Can new liquid source be created by placing two or more sources nearby?
freezemelt = "", -- water for snow/ice, ice/snow for water
leveled = 0, -- Block contain level in param2. value - default level, used for snow. Dont forget use "leveled" type nodebox
liquid_range = 8, -- number of flowing nodes arround source (max. 8)
drowning = 0, -- Player will take this amount of damage if no bubbles are left
- two or more sources nearly?
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"