* `math.round(x)`: Returns `x` rounded to the nearest integer.
* At a multiple of 0.5, rounds away from zero.
* `string.split(str, separator, include_empty, max_splits, sep_is_pattern)`
- * `separator`: string, default: `","`
+ * `separator`: string, cannot be empty, default: `","`
* `include_empty`: boolean, default: `false`
* `max_splits`: number, if it's negative, splits aren't limited,
default: `-1`
* `shadows` is a table that controls ambient shadows
* `intensity` sets the intensity of the shadows from 0 (no shadows, default) to 1 (blackness)
* This value has no effect on clients who have the "Dynamic Shadows" shader disabled.
+ * `exposure` is a table that controls automatic exposure.
+ The basic exposure factor equation is `e = 2^exposure_correction / clamp(luminance, 2^luminance_min, 2^luminance_max)`
+ * `luminance_min` set the lower luminance boundary to use in the calculation
+ * `luminance_max` set the upper luminance boundary to use in the calculation
+ * `exposure_correction` correct observed exposure by the given EV value
+ * `speed_dark_bright` set the speed of adapting to bright light
+ * `speed_bright_dark` set the speed of adapting to dark scene
+ * `center_weight_power` set the power factor for center-weighted luminance measurement
+
* `get_lighting()`: returns the current state of lighting for the player.
* Result is a table with the same fields as `light_definition` in `set_lighting`.
* `respawn()`: Respawns the player using the same mechanism as the death screen,
-- If left out or empty, any neighbor will do.
-- `group:groupname` can also be used here.
- interval = 1.0,
+ interval = 10.0,
-- Operation interval in seconds
- chance = 1,
- -- Chance of triggering `action` per-node per-interval is 1.0 / this
- -- value
+ chance = 50,
+ -- Chance of triggering `action` per-node per-interval is 1.0 / chance
min_y = -32768,
max_y = 32767,
Used by `minetest.register_chatcommand`.
+Specifies the function to be called and the privileges required when a player
+issues the command. A help message that is the concatenation of the params and
+description fields is shown when the "/help" chatcommand is issued.
+
{
- params = "<name> <privilege>", -- Short parameter description
+ params = "",
+ -- Short parameter description. See the below note.
- description = "Remove privilege from player", -- Full description
+ description = "",
+ -- General description of the command's purpose.
- privs = {privs=true}, -- Require the "privs" privilege to run
+ privs = {},
+ -- Required privileges to run. See `minetest.check_player_privs()` for
+ -- the format and see [Privileges] for an overview of privileges.
func = function(name, param),
- -- Called when command is run. Returns boolean success and text output.
- -- Special case: The help message is shown to the player if `func`
- -- returns false without a text output.
+ -- Called when command is run.
+ -- * `name` is the name of the player who issued the command.
+ -- * `param` is a string with the full arguments to the command.
+ -- Returns a boolean for success and a string value.
+ -- The string is shown to the issuing player upon exit of `func` or,
+ -- if `func` returns `false` and no string, the help message is shown.
}
-Note that in params, use of symbols is as follows:
+Note that in params, the conventional use of symbols is as follows:
* `<>` signifies a placeholder to be replaced when the command is used. For
example, when a player name is needed: `<name>`
* `()` signifies grouping. For example, when param1 and param2 are both
required, or only param3 is required: `(<param1> <param2>) | <param3>`
+Example:
+
+ {
+ params = "<name> <privilege>",
+
+ description = "Remove privilege from player",
+
+ privs = {privs=true}, -- Require the "privs" privilege to run
+
+ func = function(name, param),
+ }
+
Privilege definition
--------------------
All of the properties in this list can be animated with `*_tween` tables
unless otherwise specified. For example, `jitter` can be tweened by setting
a `jitter_tween` table instead of (or in addition to) a `jitter` table/value.
+In this section, a float range is a table defined as so: { min = A, max = B }
+A and B are your supplemented values. For a vec3 range this means they are vectors.
Types used are defined in the previous section.
* vec3 range `pos`: the position at which particles can appear