minetest.register_alias("mapgen_stone", "default:stone")
-### Aliases needed for all mapgens except Mapgen v6
+### Aliases needed for all mapgens except Mapgen V6
#### Base terrain
#### Caves
+Not required if cave liquid nodes are set in biome definitions.
+
* mapgen_lava_source
#### Dungeons
-Only needed for registered biomes where 'node_stone' is stone:
+Not required if dungeon nodes are set in biome definitions.
* mapgen_cobble
* mapgen_stair_cobble
* mapgen_mossycobble
-
-Only needed for registered biomes where 'node_stone' is desert stone:
-
* mapgen_desert_stone
* mapgen_stair_desert_stone
-
-Only needed for registered biomes where 'node_stone' is sandstone:
-
* mapgen_sandstone
* mapgen_sandstonebrick
* mapgen_stair_sandstone_block
-### Aliases needed for Mapgen v6
+### Aliases needed for Mapgen V6
#### Terrain and biomes
* mapgen_mossycobble
* mapgen_stair_desert_stone
+### Setting the node used in Mapgen Singlenode
+
+By default the world is filled with air nodes. To set a different node use, for
+example:
+
+ minetest.register_alias("mapgen_singlenode", "default:stone")
+
* `glasslike_framed`
* All face-connected nodes are drawn as one volume within a surrounding
frame.
- * The frame appearence is generated from the edges of the first texture
+ * The frame appearance is generated from the edges of the first texture
specified in `tiles`. The width of the edges used are 1/16th of texture
size: 1 pixel for 16x16, 2 pixels for 32x32 etc.
* The glass 'shine' (or other desired detail) on each node face is supplied
* `{type="node", under=pos, above=pos}`
* `{type="object", ref=ObjectRef}`
+Exact pointing location (currently only `Raycast` supports these fields):
+* `pointed_thing.intersection_point`: The absolute world coordinates of the
+ point on the selection box which is pointed at. May be in the selection box
+ if the pointer is in the box too.
+* `pointed_thing.box_id`: The ID of the pointed selection box (counting starts
+ from 1).
+* `pointed_thing.intersection_normal`: Unit vector, points outwards of the
+ selected selection box. This specifies which face is pointed at.
+ Is a null vector `{x = 0, y = 0, z = 0}` when the pointer is inside the
+ selection box.
+
There are three kinds of items: nodes, tools and craftitems.
-* Node: An item that can be placed in the world as a node.
-* Tool: An item that can be worn out and repaired, cannot be stacked, and often
- digs or deals damage.
-* Craftitem: A general purpose item that can be used in crafting recipes, eaten,
- dropped, or used on things in the world.
+* Node: Can be placed in the world's voxel grid
+* Tool: Has a wear property but cannot be stacked. The default use action is to
+ dig nodes or hit objects according to its tool capabilities.
+* Craftitem: Cannot dig nodes or be placed
Amount and wear
---------------
-All item stacks have an amount between 0 to 65535. It is 1 by
+All item stacks have an amount between 0 and 65535. It is 1 by
default. Tool item stacks can not have an amount greater than 1.
Tools use a wear (damage) value ranging from 0 to 65535. The
connect to each other
* `slippery`: Players and items will slide on the node.
Slipperiness rises steadily with `slippery` value, starting at 1.
+* `disable_repair`: If set to 1 for a tool, it cannot be repaired using the
+ `"toolrepair"` crafting recipe
Known damage and digging time defining groups
* `main`: list containing the default inventory
* `craft`: list containing the craft input
-* `craftpreview`: list containing the craft output
+* `craftpreview`: list containing the craft prediction
+* `craftresult`: list containing the crafted output
* `hand`: list containing an override for the empty hand
+ * Is not created automatically, use `InvRef:set_size`
ignored. For input use the same recipe table syntax as for
`minetest.register_craft(recipe)`. For output specify only the item,
without a quantity.
- * If no erase candidate could be found, Lua exception will be thrown.
+ * Returns false if no erase candidate could be found, otherwise returns true.
* **Warning**! The type field ("shaped", "cooking" or any other) will be
ignored if the recipe contains output. Erasing is then done independently
from the crafting method.
* Return `true` to mark the message as handled, which means that it will
not be sent to other players.
* `minetest.register_on_player_receive_fields(func(player, formname, fields))`
- * Called when a button is pressed in player's inventory form
+ * Called when a button is pressed in player's inventory form, when form
+ values are submitted or when the form is actively closed by the player.
+ * Fields are sent for formspec elements which define a field, and the "quit"
+ field is sent when actively closing the form by mouse click, keypress or
+ through a button_exit[] element.
* Newest functions are called first
* If function returns `true`, remaining functions are not called
* `minetest.register_on_craft(func(itemstack, player, old_craft_grid, craft_inv))`
Note that this parameter is mostly just a workaround and will be removed
in future releases.
* Creates a detached inventory. If it already exists, it is cleared.
+* `minetest.remove_detached_inventory(name)`
+ * Returns a `boolean` indicating whether the removal succeeded.
* `minetest.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing)`:
returns left over ItemStack.
* See `minetest.item_eat` and `minetest.register_on_item_eat`
* `set_acceleration(acc)`
* `acc` is a vector
* `get_acceleration()`: returns the acceleration, a vector
+* `set_rotation(rot)`
+ * `rot` is a vector (radians)
+* `get_rotation()` : returns the rotation, a vector (radians)
* `set_yaw(radians)`
* `get_yaw()`: returns number in radians
* `set_texture_mod(mod)`
---------
A raycast on the map. It works with selection boxes.
-Can be used as an iterator in a for loop.
+Can be used as an iterator in a for loop as:
+
+ local ray = Raycast(...)
+ for pointed_thing in ray do
+ ...
+ end
The map is loaded as the ray advances. If the map is modified after the
`Raycast` is created, the changes may or may not have an effect on the object.
### Methods
-* `next()`: returns a `pointed_thing`
+* `next()`: returns a `pointed_thing` with exact pointing location
* Returns the next thing pointed by the ray or nil.
`SecureRandom`
additional_wear = -0.02,
}
+Note: Tools with group `disable_repair=1` will not repairable by this recipe.
+
### Cooking
{
-- Disappears after expirationtime seconds
size = 1,
+ -- Scales the visual size of the particle texture.
collisiondetection = false,
- -- If true collides with physical objects
+ -- If true collides with `walkable` nodes and, depending on the
+ -- `object_collision` field, objects too.
collision_removal = false,
-- If true particle is removed when it collides.
-- Requires collisiondetection = true to have any effect.
+ object_collision = false,
+ -- If true particle collides with objects that are defined as
+ -- `physical = true,` and `collide_with_objects = true,`.
+ -- Requires collisiondetection = true to have any effect.
+
vertical = false,
-- If true faces player using y axis only
{
amount = 1,
+ -- Number of particles spawned over the time period `time`.
time = 1,
- -- If time is 0 has infinite lifespan and spawns the amount on a
- -- per-second basis.
+ -- Lifespan of spawner in seconds.
+ -- If time is 0 spawner has infinite lifespan and spawns the `amount` on
+ -- a per-second basis.
minpos = {x=0, y=0, z=0},
maxpos = {x=0, y=0, z=0},
maxexptime = 1,
minsize = 1,
maxsize = 1,
- -- The particle's properties are random values in between the bounds
+ -- The particles' properties are random values between the min and max
+ -- values.
-- pos, velocity, acceleration, expirationtime, size
collisiondetection = false,
- -- If true collides with physical objects
+ -- If true collide with `walkable` nodes and, depending on the
+ -- `object_collision` field, objects too.
collision_removal = false,
- -- If true particle is removed when it collides.
+ -- If true particles are removed when they collide.
+ -- Requires collisiondetection = true to have any effect.
+
+ object_collision = false,
+ -- If true particles collide with objects that are defined as
+ -- `physical = true,` and `collide_with_objects = true,`.
-- Requires collisiondetection = true to have any effect.
attached = ObjectRef,
-- relative to this object's position and yaw
vertical = false,
- -- If true faces player using y axis only
+ -- If true face player using y axis only
texture = "image.png",
playername = "singleplayer",
- -- Optional, if specified spawns particle only on the player's client
+ -- Optional, if specified spawns particles only on the player's client
animation = {Tile Animation definition},
- -- Optional, specifies how to animate the particle texture
+ -- Optional, specifies how to animate the particles' texture
glow = 0
-- Optional, specify particle self-luminescence in darkness.