-----------
Games can provide custom main menu music. They are put inside a `menu`
-directory inside the game directory.
+directory inside the game directory.
The music files are named `theme.ogg`.
If you want to specify multiple music files for one game, add additional
`param1` is reserved for the engine when `paramtype != "none"`.
* `paramtype = "light"`
- * The value stores light with and without sun in its upper and lower 4 bits
+ * The value stores light with and without sun in its lower and upper 4 bits
respectively.
* Required by a light source node to enable spreading its light.
* Required by the following drawtypes as they determine their visual
Version History
---------------
-* FORMSPEC VERSION 1:
+* Formspec version 1 (pre-5.1.0):
* (too much)
-* FORMSPEC VERSION 2:
+* Formspec version 2 (5.1.0):
* Forced real coordinates
* background9[]: 9-slice scaling parameters
-* FORMSPEC VERSION 3:
+* Formspec version 3 (5.2.0):
* Formspec elements are drawn in the order of definition
* bgcolor[]: use 3 parameters (bgcolor, formspec (now an enum), fbgcolor)
* box[] and image[] elements enable clipping by default
* new element: scroll_container[]
-* FORMSPEC VERSION 4:
+* Formspec version 4 (5.4.0):
* Allow dropdown indexing events
+* Formspec version 5 (5.5.0):
+ * Added padding[] element
Elements
--------
* `position` and `anchor` elements need suitable values to avoid a formspec
extending off the game window due to particular game window sizes.
-### `no_prepend[]`
+### `padding[<X>,<Y>]`
* Must be used after the `size`, `position`, and `anchor` elements (if present).
+* Defines how much space is padded around the formspec if the formspec tries to
+ increase past the size of the screen and coordinates have to be shrunk.
+* For X and Y, 0.0 represents no padding (the formspec can touch the edge of the
+ screen), and 0.5 represents half the screen (which forces the coordinate size
+ to 0). If negative, the formspec can extend off the edge of the screen.
+* Defaults to [0.05, 0.05].
+
+### `no_prepend[]`
+
+* Must be used after the `size`, `position`, `anchor`, and `padding` elements
+ (if present).
* Disables player:set_formspec_prepend() from applying to this formspec.
### `real_coordinates[<bool>]`
* `minetest.get_hit_params(groups, tool_capabilities [, time_from_last_punch [, wear]])`:
Simulates an item that punches an object.
Returns a table with the following fields:
- * `hp`: How much damage the punch would cause.
+ * `hp`: How much damage the punch would cause (between -65535 and 65535).
* `wear`: How much wear would be added to the tool (ignored for non-tools).
Parameters:
* `groups`: Damage groups of the object
* `set_sky(sky_parameters)`
* The presence of the function `set_sun`, `set_moon` or `set_stars` indicates
whether `set_sky` accepts this format. Check the legacy format otherwise.
+ * Passing no arguments resets the sky to its default values.
* `sky_parameters` is a table with the following optional fields:
* `base_color`: ColorSpec, changes fog in "skybox" and "plain".
+ (default: `#ffffff`)
* `type`: Available types:
* `"regular"`: Uses 0 textures, `base_color` ignored
* `"skybox"`: Uses 6 textures, `base_color` used as fog.
* `"plain"`: Uses 0 textures, `base_color` used as both fog and sky.
+ (default: `"regular"`)
* `textures`: A table containing up to six textures in the following
order: Y+ (top), Y- (bottom), X- (west), X+ (east), Z+ (north), Z- (south).
* `clouds`: Boolean for whether clouds appear. (default: `true`)
- * `sky_color`: A table containing the following values, alpha is ignored:
- * `day_sky`: ColorSpec, for the top half of the `"regular"`
- sky during the day. (default: `#61b5f5`)
- * `day_horizon`: ColorSpec, for the bottom half of the
- `"regular"` sky during the day. (default: `#90d3f6`)
- * `dawn_sky`: ColorSpec, for the top half of the `"regular"`
- sky during dawn/sunset. (default: `#b4bafa`)
+ * `sky_color`: A table used in `"regular"` type only, containing the
+ following values (alpha is ignored):
+ * `day_sky`: ColorSpec, for the top half of the sky during the day.
+ (default: `#61b5f5`)
+ * `day_horizon`: ColorSpec, for the bottom half of the sky during the day.
+ (default: `#90d3f6`)
+ * `dawn_sky`: ColorSpec, for the top half of the sky during dawn/sunset.
+ (default: `#b4bafa`)
The resulting sky color will be a darkened version of the ColorSpec.
Warning: The darkening of the ColorSpec is subject to change.
- * `dawn_horizon`: ColorSpec, for the bottom half of the `"regular"`
- sky during dawn/sunset. (default: `#bac1f0`)
+ * `dawn_horizon`: ColorSpec, for the bottom half of the sky during dawn/sunset.
+ (default: `#bac1f0`)
The resulting sky color will be a darkened version of the ColorSpec.
Warning: The darkening of the ColorSpec is subject to change.
- * `night_sky`: ColorSpec, for the top half of the `"regular"`
- sky during the night. (default: `#006bff`)
+ * `night_sky`: ColorSpec, for the top half of the sky during the night.
+ (default: `#006bff`)
The resulting sky color will be a dark version of the ColorSpec.
Warning: The darkening of the ColorSpec is subject to change.
- * `night_horizon`: ColorSpec, for the bottom half of the `"regular"`
- sky during the night. (default: `#4090ff`)
+ * `night_horizon`: ColorSpec, for the bottom half of the sky during the night.
+ (default: `#4090ff`)
The resulting sky color will be a dark version of the ColorSpec.
Warning: The darkening of the ColorSpec is subject to change.
- * `indoors`: ColorSpec, for when you're either indoors or
- underground. Only applies to the `"regular"` sky.
+ * `indoors`: ColorSpec, for when you're either indoors or underground.
(default: `#646464`)
* `fog_sun_tint`: ColorSpec, changes the fog tinting for the sun
- at sunrise and sunset.
+ at sunrise and sunset. (default: `#f47d1d`)
* `fog_moon_tint`: ColorSpec, changes the fog tinting for the moon
- at sunrise and sunset.
+ at sunrise and sunset. (default: `#7f99cc`)
* `fog_tint_type`: string, changes which mode the directional fog
abides by, `"custom"` uses `sun_tint` and `moon_tint`, while
`"default"` uses the classic Minetest sun and moon tinting.
* `get_sky_color()`: returns a table with the `sky_color` parameters as in
`set_sky`.
* `set_sun(sun_parameters)`:
+ * Passing no arguments resets the sun to its default values.
* `sun_parameters` is a table with the following optional fields:
* `visible`: Boolean for whether the sun is visible.
(default: `true`)
* `texture`: A regular texture for the sun. Setting to `""`
- will re-enable the mesh sun. (default: `"sun.png"`)
+ will re-enable the mesh sun. (default: "sun.png", if it exists)
* `tonemap`: A 512x1 texture containing the tonemap for the sun
(default: `"sun_tonemap.png"`)
* `sunrise`: A regular texture for the sunrise texture.
* `get_sun()`: returns a table with the current sun parameters as in
`set_sun`.
* `set_moon(moon_parameters)`:
+ * Passing no arguments resets the moon to its default values.
* `moon_parameters` is a table with the following optional fields:
* `visible`: Boolean for whether the moon is visible.
(default: `true`)
* `texture`: A regular texture for the moon. Setting to `""`
- will re-enable the mesh moon. (default: `"moon.png"`)
+ will re-enable the mesh moon. (default: "moon.png", if it exists)
* `tonemap`: A 512x1 texture containing the tonemap for the moon
(default: `"moon_tonemap.png"`)
* `scale`: Float controlling the overall size of the moon (default: `1`)
* `get_moon()`: returns a table with the current moon parameters as in
`set_moon`.
* `set_stars(star_parameters)`:
+ * Passing no arguments resets stars to their default values.
* `star_parameters` is a table with the following optional fields:
* `visible`: Boolean for whether the stars are visible.
(default: `true`)
* `get_stars()`: returns a table with the current stars parameters as in
`set_stars`.
* `set_clouds(cloud_parameters)`: set cloud parameters
+ * Passing no arguments resets clouds to their default values.
* `cloud_parameters` is a table with the following optional fields:
* `density`: from `0` (no clouds) to `1` (full clouds) (default `0.4`)
* `color`: basic cloud color with alpha channel, ColorSpec
items = {"default:sand", "default:desert_sand"},
},
{
- -- Only drop if using an item in the "magicwand" group, or
+ -- Only drop if using an item in the "magicwand" group, or
-- an item that is in both the "pickaxe" and the "lucky"
-- groups.
tool_groups = {