Skip to content

Commit 3e6da81

Browse files
p-ouelletteparamat
authored andcommittedAug 3, 2018
lua_api.txt: Improve code block format (#7599)
Remove ^ and --[[ ]] symbols. Fix comment indentation level. Separate fields with blank lines. Remove period from single-sentence descriptions, add periods to multi-sentence descriptions. Separate inline comments from the code with two spaces.
1 parent f399702 commit 3e6da81

File tree

1 file changed

+820
-641
lines changed

1 file changed

+820
-641
lines changed
 

Diff for: ‎doc/lua_api.txt

+820-641
Original file line numberDiff line numberDiff line change
@@ -5176,105 +5176,134 @@ Definition tables
51765176
Object properties
51775177
-----------------
51785178

5179-
Used by `ObjectRef` methods.
5179+
Used by `ObjectRef` methods. Part of an Entity definition.
51805180

51815181
{
51825182
hp_max = 1,
5183-
-- ^ For players: Defaults to `minetest.PLAYER_MAX_HP_DEFAULT`
5183+
-- For players only. Defaults to `minetest.PLAYER_MAX_HP_DEFAULT`.
5184+
51845185
breath_max = 0,
5185-
-- ^ For players only. Defaults to `minetest.PLAYER_MAX_BREATH_DEFAULT`
5186+
-- For players only. Defaults to `minetest.PLAYER_MAX_BREATH_DEFAULT`.
5187+
51865188
zoom_fov = 0.0,
5187-
-- ^ For players only. Zoom FOV in degrees.
5188-
-- Note that zoom loads and/or generates world beyond the server's
5189-
-- maximum send and generate distances, so acts like a telescope.
5190-
-- Smaller zoomFOV values increase the distance loaded and/or generated.
5191-
-- Defaults to 15 in creative mode, 0 in survival mode.
5192-
-- zoom_fov = 0 disables zooming for the player.
5189+
-- For players only. Zoom FOV in degrees.
5190+
-- Note that zoom loads and/or generates world beyond the server's
5191+
-- maximum send and generate distances, so acts like a telescope.
5192+
-- Smaller zoom_fov values increase the distance loaded/generated.
5193+
-- Defaults to 15 in creative mode, 0 in survival mode.
5194+
-- zoom_fov = 0 disables zooming for the player.
5195+
51935196
eye_height = 1.625,
5194-
-- ^ For players only. Camera height above feet position in nodes.
5195-
-- Defaults to 1.625.
5197+
-- For players only. Camera height above feet position in nodes.
5198+
-- Defaults to 1.625.
5199+
51965200
physical = true,
5201+
51975202
collide_with_objects = true,
5198-
-- ^ Collide with other objects if physical = true.
5203+
-- Collide with other objects if physical = true
5204+
51995205
weight = 5,
5200-
collisionbox = {-0.5, 0.0, -0.5, 0.5, 1.0, 0.5},
5206+
5207+
collisionbox = {-0.5, 0.0, -0.5, 0.5, 1.0, 0.5}, -- Default
52015208
selectionbox = {-0.5, 0.0, -0.5, 0.5, 1.0, 0.5},
5202-
-- ^ Default, uses collision box dimensions when not set.
5203-
-- ^ For both boxes: {xmin, ymin, zmin, xmax, ymax, zmax} in nodes from
5204-
-- object position.
5209+
-- Selection box uses collision box dimensions when not set.
5210+
-- For both boxes: {xmin, ymin, zmin, xmax, ymax, zmax} in nodes from
5211+
-- object position.
5212+
52055213
pointable = true,
5206-
-- ^ Overrides selection box when false.
5214+
-- Overrides selection box when false
5215+
52075216
visual = "cube" / "sprite" / "upright_sprite" / "mesh" / "wielditem",
5208-
-- ^ "cube" is a node-sized cube.
5209-
-- ^ "sprite" is a flat texture always facing the player.
5210-
-- ^ "upright_sprite" is a vertical flat texture.
5211-
-- ^ "mesh" uses the defined mesh model.
5212-
-- ^ "wielditem" is used for dropped items
5213-
-- (see builtin/game/item_entity.lua).
5214-
-- For this use 'textures = {itemname}'.
5215-
-- If the item has a 'wield_image' the object will be an extrusion of
5216-
-- that, otherwise:
5217-
-- If 'itemname' is a cubic node or nodebox the object will appear
5218-
-- identical to 'itemname'.
5219-
-- If 'itemname' is a plantlike node the object will be an extrusion of
5220-
-- its texture.
5221-
-- Otherwise for non-node items, the object will be an extrusion of
5222-
-- 'inventory_image'.
5217+
-- "cube" is a node-sized cube.
5218+
-- "sprite" is a flat texture always facing the player.
5219+
-- "upright_sprite" is a vertical flat texture.
5220+
-- "mesh" uses the defined mesh model.
5221+
-- "wielditem" is used for dropped items.
5222+
-- (see builtin/game/item_entity.lua).
5223+
-- For this use 'textures = {itemname}'.
5224+
-- If the item has a 'wield_image' the object will be an extrusion of
5225+
-- that, otherwise:
5226+
-- If 'itemname' is a cubic node or nodebox the object will appear
5227+
-- identical to 'itemname'.
5228+
-- If 'itemname' is a plantlike node the object will be an extrusion
5229+
-- of its texture.
5230+
-- Otherwise for non-node items, the object will be an extrusion of
5231+
-- 'inventory_image'.
5232+
52235233
visual_size = {x = 1, y = 1},
5224-
-- ^ `x` multiplies horizontal (X and Z) visual size.
5225-
-- ^ `y` multiplies vertical (Y) visual size.
5234+
-- `x` multiplies horizontal (X and Z) visual size.
5235+
-- `y` multiplies vertical (Y) visual size.
5236+
52265237
mesh = "model",
5238+
52275239
textures = {},
5228-
-- ^ Number of required textures depends on visual.
5229-
-- ^ "cube" uses 6 textures in the way a node does.
5230-
-- ^ "sprite" uses 1 texture.
5231-
-- ^ "upright_sprite" uses 2 textures: {front, back}.
5232-
-- ^ "wielditem" expects 'textures = {itemname}' (see 'visual' above).
5240+
-- Number of required textures depends on visual.
5241+
-- "cube" uses 6 textures in the way a node does.
5242+
-- "sprite" uses 1 texture.
5243+
-- "upright_sprite" uses 2 textures: {front, back}.
5244+
-- "wielditem" expects 'textures = {itemname}' (see 'visual' above).
5245+
52335246
colors = {},
5234-
-- ^ Number of required colors depends on visual.
5247+
-- Number of required colors depends on visual
5248+
52355249
use_texture_alpha = false,
5236-
-- ^ Use texture's alpha channel, excludes "upright_sprite" and "wielditem"
5237-
-- ^ Note: currently causes visual issues when viewed through other
5238-
-- ^ semi-transparent materials such as water.
5250+
-- Use texture's alpha channel.
5251+
-- Excludes "upright_sprite" and "wielditem".
5252+
-- Note: currently causes visual issues when viewed through other
5253+
-- semi-transparent materials such as water.
5254+
52395255
spritediv = {x = 1, y = 1},
5240-
-- ^ Used with spritesheet textures for animation and/or frame selection
5241-
-- according to position relative to player.
5242-
-- ^ Defines the number of columns and rows in the spritesheet:
5243-
-- {columns, rows}.
5256+
-- Used with spritesheet textures for animation and/or frame selection
5257+
-- according to position relative to player.
5258+
-- Defines the number of columns and rows in the spritesheet:
5259+
-- {columns, rows}.
5260+
52445261
initial_sprite_basepos = {x = 0, y = 0},
5245-
-- ^ Used with spritesheet textures.
5246-
-- ^ Defines the {column, row} position of the initially used frame in the
5247-
-- spritesheet.
5262+
-- Used with spritesheet textures.
5263+
-- Defines the {column, row} position of the initially used frame in the
5264+
-- spritesheet.
5265+
52485266
is_visible = true,
5267+
52495268
makes_footstep_sound = false,
5269+
52505270
automatic_rotate = 0,
5251-
-- ^ Set constant rotation in radians per second, positive or negative.
5252-
-- ^ Set to 0 to disable constant rotation.
5271+
-- Set constant rotation in radians per second, positive or negative.
5272+
-- Set to 0 to disable constant rotation.
5273+
52535274
stepheight = 0,
5275+
52545276
automatic_face_movement_dir = 0.0,
5255-
-- ^ Automatically set yaw to movement direction, offset in degrees,
5256-
-- 'false' to disable.
5277+
-- Automatically set yaw to movement direction, offset in degrees.
5278+
-- 'false' to disable.
5279+
52575280
automatic_face_movement_max_rotation_per_sec = -1,
5258-
-- ^ Limit automatic rotation to this value in degrees per second,
5259-
-- value < 0 no limit.
5281+
-- Limit automatic rotation to this value in degrees per second.
5282+
-- No limit if value < 0.
5283+
52605284
backface_culling = true,
5261-
-- ^ Set to false to disable backface_culling for model.
5285+
-- Set to false to disable backface_culling for model
5286+
52625287
glow = 0,
5263-
-- ^ Add this much extra lighting when calculating texture color.
5264-
-- Value < 0 disables light's effect on texture color.
5265-
-- For faking self-lighting, UI style entities, or programmatic coloring
5266-
-- in mods.
5288+
-- Add this much extra lighting when calculating texture color.
5289+
-- Value < 0 disables light's effect on texture color.
5290+
-- For faking self-lighting, UI style entities, or programmatic coloring
5291+
-- in mods.
5292+
52675293
nametag = "",
5268-
-- ^ By default empty, for players their name is shown if empty.
5269-
nametag_color = <color>,
5270-
-- ^ Sets color of nametag as ColorSpec.
5294+
-- By default empty, for players their name is shown if empty
5295+
5296+
nametag_color = <ColorSpec>,
5297+
-- Sets color of nametag
5298+
52715299
infotext = "",
5272-
-- ^ By default empty, text to be shown when pointed at object.
5300+
-- By default empty, text to be shown when pointed at object
5301+
52735302
static_save = true,
5274-
-- ^ If false, never save this object statically. It will simply be
5275-
-- deleted when the block gets unloaded.
5276-
-- The get_staticdata() callback is never called then.
5277-
-- Defaults to 'true'
5303+
-- If false, never save this object statically. It will simply be
5304+
-- deleted when the block gets unloaded.
5305+
-- The get_staticdata() callback is never called then.
5306+
-- Defaults to 'true'.
52785307
}
52795308

52805309
Entity definition
@@ -5288,21 +5317,26 @@ Used by `minetest.register_entity`.
52885317
mesh = "boats_boat.obj",
52895318
...,
52905319
},
5291-
-- ^ A table of object properties, see the `Object properties` section.
5292-
-- ^ Object properties being read directly from the entity definition
5293-
-- table is deprecated. Define object properties in this
5294-
-- `initial_properties` table instead.
5320+
-- A table of object properties, see the `Object properties` section.
5321+
-- Object properties being read directly from the entity definition
5322+
-- table is deprecated. Define object properties in this
5323+
-- `initial_properties` table instead.
5324+
52955325
on_activate = function(self, staticdata, dtime_s),
5326+
52965327
on_step = function(self, dtime),
5328+
52975329
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir),
5330+
52985331
on_rightclick = function(self, clicker),
5332+
52995333
get_staticdata = function(self),
5300-
-- ^ Called sometimes; the string returned is passed to on_activate when
5301-
-- the entity is re-activated from static state
5334+
-- Called sometimes; the string returned is passed to on_activate when
5335+
-- the entity is re-activated from static state
53025336

53035337
_custom_field = whatever,
5304-
-- ^ You can define arbitrary member variables here (see item definition
5305-
-- for more info) by using a '_' prefix.
5338+
-- You can define arbitrary member variables here (see Item definition
5339+
-- for more info) by using a '_' prefix
53065340
}
53075341

53085342
ABM (ActiveBlockModifier) definition
@@ -5312,34 +5346,40 @@ Used by `minetest.register_abm`.
53125346

53135347
{
53145348
label = "Lava cooling",
5315-
^ Descriptive label for profiling purposes (optional).
5316-
Definitions with identical labels will be listed as one.
5349+
-- Descriptive label for profiling purposes (optional).
5350+
-- Definitions with identical labels will be listed as one.
5351+
53175352
nodenames = {"default:lava_source"},
5318-
^ Apply `action` function to these nodes.
5319-
^ `group:groupname` can also be used here.
5353+
-- Apply `action` function to these nodes.
5354+
-- `group:groupname` can also be used here.
5355+
53205356
neighbors = {"default:water_source", "default:water_flowing"},
5321-
^ Only apply `action` to nodes that have one of, or any
5322-
combination of, these neighbors.
5323-
^ If left out or empty, any neighbor will do.
5324-
^ `group:groupname` can also be used here.
5357+
-- Only apply `action` to nodes that have one of, or any
5358+
-- combination of, these neighbors.
5359+
-- If left out or empty, any neighbor will do.
5360+
-- `group:groupname` can also be used here.
5361+
53255362
interval = 1.0,
5326-
^ Operation interval in seconds.
5363+
-- Operation interval in seconds
5364+
53275365
chance = 1,
5328-
^ Chance of triggering `action` per-node per-interval is 1.0 / this
5329-
value.
5366+
-- Chance of triggering `action` per-node per-interval is 1.0 / this
5367+
-- value
5368+
53305369
catch_up = true,
5331-
^ If true, catch-up behaviour is enabled: The `chance` value is
5332-
temporarily reduced when returning to an area to simulate time lost
5333-
by the area being unattended. Note that the `chance` value can often
5334-
be reduced to 1.
5370+
-- If true, catch-up behaviour is enabled: The `chance` value is
5371+
-- temporarily reduced when returning to an area to simulate time lost
5372+
-- by the area being unattended. Note that the `chance` value can often
5373+
-- be reduced to 1.
5374+
53355375
action = function(pos, node, active_object_count, active_object_count_wider),
5336-
^ Function triggered for each qualifying node.
5337-
^ `active_object_count` is number of active objects in the node's
5338-
mapblock.
5339-
^ `active_object_count_wider` is number of active objects in the node's
5340-
mapblock plus all 26 neighboring mapblocks. If any neighboring
5341-
mapblocks are unloaded an estmate is calculated for them based on
5342-
loaded mapblocks.
5376+
-- Function triggered for each qualifying node.
5377+
-- `active_object_count` is number of active objects in the node's
5378+
-- mapblock.
5379+
-- `active_object_count_wider` is number of active objects in the node's
5380+
-- mapblock plus all 26 neighboring mapblocks. If any neighboring
5381+
-- mapblocks are unloaded an estmate is calculated for them based on
5382+
-- loaded mapblocks.
53435383
}
53445384

53455385
LBM (LoadingBlockModifier) definition
@@ -5349,17 +5389,21 @@ Used by `minetest.register_lbm`.
53495389

53505390
{
53515391
label = "Upgrade legacy doors",
5352-
-- ^ Descriptive label for profiling purposes (optional).
5353-
-- Definitions with identical labels will be listed as one.
5392+
-- Descriptive label for profiling purposes (optional).
5393+
-- Definitions with identical labels will be listed as one.
5394+
53545395
name = "modname:replace_legacy_door",
5396+
53555397
nodenames = {"default:lava_source"},
5356-
-- ^ List of node names to trigger the LBM on.
5357-
-- Also non-registered nodes will work.
5358-
-- Groups (as of group:groupname) will work as well.
5398+
-- List of node names to trigger the LBM on.
5399+
-- Also non-registered nodes will work.
5400+
-- Groups (as of group:groupname) will work as well.
5401+
53595402
run_at_every_load = false,
5360-
-- ^ Whether to run the LBM's action every time a block gets loaded,
5361-
-- and not just for blocks that were saved last time before LBMs were
5362-
-- introduced to the world.
5403+
-- Whether to run the LBM's action every time a block gets loaded,
5404+
-- and not just for blocks that were saved last time before LBMs were
5405+
-- introduced to the world.
5406+
53635407
action = func(pos, node),
53645408
}
53655409

@@ -5371,32 +5415,43 @@ Used by `minetest.register_node`, `minetest.register_craftitem`, and
53715415

53725416
{
53735417
description = "Steel Axe",
5374-
groups = {}, -- key = name, value = rating; rating = 1..3.
5375-
if rating not applicable, use 1.
5376-
e.g. {wool = 1, fluffy = 3}
5377-
{soil = 2, outerspace = 1, crumbly = 1}
5378-
{bendy = 2, snappy = 1},
5379-
{hard = 1, metal = 1, spikes = 1}
5418+
5419+
groups = {},
5420+
-- key = name, value = rating; rating = 1..3.
5421+
-- If rating not applicable, use 1.
5422+
-- e.g. {wool = 1, fluffy = 3}
5423+
{soil = 2, outerspace = 1, crumbly = 1}
5424+
{bendy = 2, snappy = 1},
5425+
{hard = 1, metal = 1, spikes = 1}
5426+
53805427
inventory_image = "default_tool_steelaxe.png",
5428+
53815429
inventory_overlay = "overlay.png",
5382-
^ An overlay which does not get colorized.
5430+
-- An overlay which does not get colorized
5431+
53835432
wield_image = "",
5433+
53845434
wield_overlay = "",
5435+
53855436
palette = "",
5386-
--[[
5387-
^ An image file containing the palette of a node.
5388-
^ You can set the currently used color as the
5389-
^ "palette_index" field of the item stack metadata.
5390-
^ The palette is always stretched to fit indices
5391-
^ between 0 and 255, to ensure compatibility with
5392-
^ "colorfacedir" and "colorwallmounted" nodes.
5393-
]]
5437+
-- An image file containing the palette of a node.
5438+
-- You can set the currently used color as the "palette_index" field of
5439+
-- the item stack metadata.
5440+
-- The palette is always stretched to fit indices between 0 and 255, to
5441+
-- ensure compatibility with "colorfacedir" and "colorwallmounted" nodes.
5442+
53945443
color = "0xFFFFFFFF",
5395-
^ The color of the item. The palette overrides this.
5444+
-- The color of the item. The palette overrides this.
5445+
53965446
wield_scale = {x = 1, y = 1, z = 1},
5447+
53975448
stack_max = 99,
5449+
53985450
range = 4.0,
5451+
53995452
liquids_pointable = false,
5453+
5454+
-- See "Tools" section
54005455
tool_capabilities = {
54015456
full_punch_interval = 1.0,
54025457
max_drop_level = 0,
@@ -5407,84 +5462,79 @@ Used by `minetest.register_node`, `minetest.register_craftitem`, and
54075462
},
54085463
damage_groups = {groupname = damage},
54095464
},
5465+
54105466
node_placement_prediction = nil,
5411-
--[[
5412-
^ If nil and item is node, prediction is made automatically
5413-
^ If nil and item is not a node, no prediction is made
5414-
^ If "" and item is anything, no prediction is made
5415-
^ Otherwise should be name of node which the client immediately places
5416-
on ground when the player places the item. Server will always update
5417-
actual result to client in a short moment.
5418-
]]
5467+
-- If nil and item is node, prediction is made automatically.
5468+
-- If nil and item is not a node, no prediction is made.
5469+
-- If "" and item is anything, no prediction is made.
5470+
-- Otherwise should be name of node which the client immediately places
5471+
-- on ground when the player places the item. Server will always update
5472+
-- actual result to client in a short moment.
5473+
54195474
node_dig_prediction = "air",
5420-
--[[
5421-
^ if "", no prediction is made
5422-
^ if "air", node is removed
5423-
^ Otherwise should be name of node which the client immediately places
5424-
upon digging. Server will always update actual result shortly.
5425-
]]
5475+
-- if "", no prediction is made.
5476+
-- if "air", node is removed.
5477+
-- Otherwise should be name of node which the client immediately places
5478+
-- upon digging. Server will always update actual result shortly.
5479+
54265480
sound = {
5427-
breaks = "default_tool_break", -- tools only
5428-
place = --[[<SimpleSoundSpec>]],
5481+
breaks = "default_tool_break", -- tools only
5482+
place = <SimpleSoundSpec>,
54295483
},
54305484

54315485
on_place = func(itemstack, placer, pointed_thing),
5432-
--[[
5433-
^ Shall place item and return the leftover itemstack
5434-
^ The placer may be any ObjectRef or nil.
5435-
^ default: minetest.item_place ]]
5486+
-- Shall place item and return the leftover itemstack.
5487+
-- The placer may be any ObjectRef or nil.
5488+
-- default: minetest.item_place
5489+
54365490
on_secondary_use = func(itemstack, user, pointed_thing),
5437-
--[[
5438-
^ Same as on_place but called when pointing at nothing.
5439-
^ The user may be any ObjectRef or nil.
5440-
^ pointed_thing : always { type = "nothing" }
5441-
]]
5491+
-- Same as on_place but called when pointing at nothing.
5492+
-- The user may be any ObjectRef or nil.
5493+
-- pointed_thing: always { type = "nothing" }
5494+
54425495
on_drop = func(itemstack, dropper, pos),
5443-
--[[
5444-
^ Shall drop item and return the leftover itemstack
5445-
^ The dropper may be any ObjectRef or nil.
5446-
^ default: minetest.item_drop ]]
5496+
-- Shall drop item and return the leftover itemstack.
5497+
-- The dropper may be any ObjectRef or nil.
5498+
-- default: minetest.item_drop
5499+
54475500
on_use = func(itemstack, user, pointed_thing),
5448-
--[[
5449-
^ default: nil
5450-
^ Function must return either nil if no item shall be removed from
5451-
inventory, or an itemstack to replace the original itemstack.
5452-
e.g. itemstack:take_item(); return itemstack
5453-
^ Otherwise, the function is free to do what it wants.
5454-
^ The user may be any ObjectRef or nil.
5455-
^ The default functions handle regular use cases.
5456-
]]
5501+
-- default: nil
5502+
-- Function must return either nil if no item shall be removed from
5503+
-- inventory, or an itemstack to replace the original itemstack.
5504+
-- e.g. itemstack:take_item(); return itemstack
5505+
-- Otherwise, the function is free to do what it wants.
5506+
-- The user may be any ObjectRef or nil.
5507+
-- The default functions handle regular use cases.
5508+
54575509
after_use = func(itemstack, user, node, digparams),
5458-
--[[
5459-
^ default: nil
5460-
^ If defined, should return an itemstack and will be called instead of
5461-
wearing out the tool. If returns nil, does nothing.
5462-
If after_use doesn't exist, it is the same as:
5463-
function(itemstack, user, node, digparams)
5464-
itemstack:add_wear(digparams.wear)
5465-
return itemstack
5466-
end
5467-
^ The user may be any ObjectRef or nil.
5468-
]]
5510+
-- default: nil
5511+
-- If defined, should return an itemstack and will be called instead of
5512+
-- wearing out the tool. If returns nil, does nothing.
5513+
-- If after_use doesn't exist, it is the same as:
5514+
-- function(itemstack, user, node, digparams)
5515+
-- itemstack:add_wear(digparams.wear)
5516+
-- return itemstack
5517+
-- end
5518+
-- The user may be any ObjectRef or nil.
5519+
54695520
_custom_field = whatever,
5470-
--[[
5471-
^ Add your own custom fields. By convention, all custom field names
5472-
should start with `_` to avoid naming collisions with future engine
5473-
usage.
5474-
]]
5521+
-- Add your own custom fields. By convention, all custom field names
5522+
-- should start with `_` to avoid naming collisions with future engine
5523+
-- usage.
54755524
}
54765525

54775526
Tile definition
54785527
---------------
5528+
54795529
* `"image.png"`
54805530
* `{name="image.png", animation={Tile Animation definition}}`
54815531
* `{name="image.png", backface_culling=bool, tileable_vertical=bool,
5482-
tileable_horizontal=bool, align_style="node"/"world"/"user", scale=int}`
5532+
tileable_horizontal=bool, align_style="node"/"world"/"user", scale=int}`
54835533
* backface culling enabled by default for most nodes
54845534
* tileable flags are info for shaders, how they should treat texture
5485-
when displacement mapping is used
5535+
when displacement mapping is used.
54865536
Directions are from the point of view of the tile texture,
5487-
not the node it's on
5537+
not the node it's on.
54885538
* align style determines whether the texture will be rotated with the node
54895539
or kept aligned with its surroundings. "user" means that client
54905540
setting will be used, similar to `glasslike_framed_optional`.
@@ -5505,22 +5555,28 @@ Tile animation definition
55055555

55065556
{
55075557
type = "vertical_frames",
5558+
55085559
aspect_w = 16,
5509-
-- ^ specify width of a frame in pixels
5560+
-- Width of a frame in pixels
5561+
55105562
aspect_h = 16,
5511-
-- ^ specify height of a frame in pixels
5563+
-- Height of a frame in pixels
5564+
55125565
length = 3.0,
5513-
-- ^ specify full loop length
5566+
-- Full loop length
55145567
}
55155568

55165569
{
55175570
type = "sheet_2d",
5571+
55185572
frames_w = 5,
5519-
-- ^ specify width in number of frames
5573+
-- Width in number of frames
5574+
55205575
frames_h = 3,
5521-
-- ^ specify height in number of frames
5576+
-- Height in number of frames
5577+
55225578
frame_length = 0.5,
5523-
-- ^ specify length of a single frame
5579+
-- Length of a single frame
55245580
}
55255581

55265582
Node definition
@@ -5531,252 +5587,284 @@ Used by `minetest.register_node`.
55315587
{
55325588
-- <all fields allowed in item definitions>,
55335589

5534-
drawtype = "normal", -- See "Node drawtypes"
5535-
visual_scale = 1.0, --[[
5536-
^ Supported for drawtypes "plantlike", "signlike", "torchlike",
5537-
^ "firelike", "mesh".
5538-
^ For plantlike and firelike, the image will start at the bottom of the
5539-
^ node, for the other drawtypes the image will be centered on the node.
5540-
^ Note that positioning for "torchlike" may still change. ]]
5541-
tiles = {tile definition 1, def2, def3, def4, def5, def6}, --[[
5542-
^ Textures of node; +Y, -Y, +X, -X, +Z, -Z
5543-
^ Old field name was 'tile_images'.
5544-
^ List can be shortened to needed length ]]
5545-
overlay_tiles = {tile definition 1, def2, def3, def4, def5, def6}, --[[
5546-
^ Same as `tiles`, but these textures are drawn on top of the
5547-
^ base tiles. You can use this to colorize only specific parts of
5548-
^ your texture. If the texture name is an empty string, that
5549-
^ overlay is not drawn. Since such tiles are drawn twice, it
5550-
^ is not recommended to use overlays on very common nodes. ]]
5551-
special_tiles = {tile definition 1, Tile definition 2}, --[[
5552-
^ Special textures of node; used rarely
5553-
^ Old field name was 'special_materials'.
5554-
^ List can be shortened to needed length ]]
5555-
color = ColorSpec, --[[
5556-
^ The node's original color will be multiplied with this color.
5557-
^ If the node has a palette, then this setting only has an effect
5558-
^ in the inventory and on the wield item. ]]
5590+
drawtype = "normal", -- See "Node drawtypes"
5591+
5592+
visual_scale = 1.0,
5593+
-- Supported for drawtypes "plantlike", "signlike", "torchlike",
5594+
-- "firelike", "mesh".
5595+
-- For plantlike and firelike, the image will start at the bottom of the
5596+
-- node, for the other drawtypes the image will be centered on the node.
5597+
-- Note that positioning for "torchlike" may still change.
5598+
5599+
tiles = {tile definition 1, def2, def3, def4, def5, def6},
5600+
-- Textures of node; +Y, -Y, +X, -X, +Z, -Z
5601+
-- Old field name was 'tile_images'.
5602+
-- List can be shortened to needed length.
5603+
5604+
overlay_tiles = {tile definition 1, def2, def3, def4, def5, def6},
5605+
-- Same as `tiles`, but these textures are drawn on top of the base
5606+
-- tiles. You can use this to colorize only specific parts of your
5607+
-- texture. If the texture name is an empty string, that overlay is not
5608+
-- drawn. Since such tiles are drawn twice, it is not recommended to use
5609+
-- overlays on very common nodes.
5610+
5611+
special_tiles = {tile definition 1, Tile definition 2},
5612+
-- Special textures of node; used rarely.
5613+
-- Old field name was 'special_materials'.
5614+
-- List can be shortened to needed length.
5615+
5616+
color = ColorSpec,
5617+
-- The node's original color will be multiplied with this color.
5618+
-- If the node has a palette, then this setting only has an effect in
5619+
-- the inventory and on the wield item.
5620+
55595621
use_texture_alpha = false,
5560-
^ Use texture's alpha channel.
5561-
palette = "palette.png", --[[
5562-
^ The node's `param2` is used to select a pixel from the image
5563-
^ (pixels are arranged from left to right and from top to bottom).
5564-
^ The node's color will be multiplied with the selected pixel's
5565-
^ color. Tiles can override this behavior.
5566-
^ Only when `paramtype2` supports palettes. ]]
5622+
-- Use texture's alpha channel
5623+
5624+
palette = "palette.png",
5625+
-- The node's `param2` is used to select a pixel from the image.
5626+
-- Pixels are arranged from left to right and from top to bottom.
5627+
-- The node's color will be multiplied with the selected pixel's color.
5628+
-- Tiles can override this behavior.
5629+
-- Only when `paramtype2` supports palettes.
5630+
55675631
post_effect_color = "green#0F",
5568-
^ Screen tint if player is inside node, see "ColorSpec".
5569-
paramtype = "none", -- See "Nodes".
5570-
paramtype2 = "none", -- See "Nodes"
5571-
place_param2 = nil, -- Force value for param2 when player places node
5632+
-- Screen tint if player is inside node, see "ColorSpec".
5633+
5634+
paramtype = "none", -- See "Nodes"
5635+
5636+
paramtype2 = "none", -- See "Nodes"
5637+
5638+
place_param2 = nil, -- Force value for param2 when player places node
5639+
55725640
is_ground_content = true,
5573-
^ If false, the cave generator will not carve through this node.
5641+
-- If false, the cave generator will not carve through this node
5642+
55745643
sunlight_propagates = false,
5575-
^ If true, sunlight will go infinitely through this.
5576-
walkable = true, -- If true, objects collide with node
5577-
pointable = true, -- If true, can be pointed at
5578-
diggable = true, -- If false, can never be dug
5579-
climbable = false, -- If true, can be climbed on (ladder)
5580-
buildable_to = false, -- If true, placed nodes can replace this node
5581-
floodable = false, --[[
5582-
^ If true, liquids flow into and replace this node.
5583-
^ Warning: making a liquid node 'floodable' will cause problems. ]]
5584-
liquidtype = "none", -- "none"/"source"/"flowing"
5585-
liquid_alternative_flowing = "", -- Flowing version of source liquid
5586-
liquid_alternative_source = "", -- Source version of flowing liquid
5587-
liquid_viscosity = 0, -- Higher viscosity = slower flow (max. 7)
5588-
liquid_renewable = true, --[[
5589-
^ If true, a new liquid source can be created by placing two or more
5590-
sources nearby. ]]
5591-
leveled = 16, --[[
5592-
^ Only valid for "nodebox" drawtype with 'type = "leveled"'.
5593-
^ Allows defining the nodebox height without using param2.
5594-
^ The nodebox height is 'leveled' / 64 nodes.
5595-
^ The maximum value of 'leveled' is 127. ]]
5596-
liquid_range = 8, -- number of flowing nodes around source (max. 8)
5644+
-- If true, sunlight will go infinitely through this node
5645+
5646+
walkable = true, -- If true, objects collide with node
5647+
5648+
pointable = true, -- If true, can be pointed at
5649+
5650+
diggable = true, -- If false, can never be dug
5651+
5652+
climbable = false, -- If true, can be climbed on (ladder)
5653+
5654+
buildable_to = false, -- If true, placed nodes can replace this node
5655+
5656+
floodable = false,
5657+
-- If true, liquids flow into and replace this node.
5658+
-- Warning: making a liquid node 'floodable' will cause problems.
5659+
5660+
liquidtype = "none", -- "none" / "source" / "flowing"
5661+
5662+
liquid_alternative_flowing = "", -- Flowing version of source liquid
5663+
5664+
liquid_alternative_source = "", -- Source version of flowing liquid
5665+
5666+
liquid_viscosity = 0, -- Higher viscosity = slower flow (max. 7)
5667+
5668+
liquid_renewable = true,
5669+
-- If true, a new liquid source can be created by placing two or more
5670+
-- sources nearby
5671+
5672+
leveled = 16,
5673+
-- Only valid for "nodebox" drawtype with 'type = "leveled"'.
5674+
-- Allows defining the nodebox height without using param2.
5675+
-- The nodebox height is 'leveled' / 64 nodes.
5676+
-- The maximum value of 'leveled' is 127.
5677+
5678+
liquid_range = 8, -- Number of flowing nodes around source (max. 8)
5679+
55975680
drowning = 0,
5598-
^ Player will take this amount of damage if no bubbles are left.
5599-
light_source = 0, --[[
5600-
^ Amount of light emitted by node.
5601-
^ To set the maximum (currently 14), use the value
5602-
^ 'minetest.LIGHT_MAX'.
5603-
^ A value outside the range 0 to minetest.LIGHT_MAX causes undefined
5604-
^ behavior.]]
5681+
-- Player will take this amount of damage if no bubbles are left
5682+
5683+
light_source = 0,
5684+
-- Amount of light emitted by node.
5685+
-- To set the maximum (14), use the value 'minetest.LIGHT_MAX'.
5686+
-- A value outside the range 0 to minetest.LIGHT_MAX causes undefined
5687+
-- behavior.
5688+
56055689
damage_per_second = 0,
5606-
^ If player is inside node, this damage is caused.
5607-
node_box = {type="regular"}, -- See "Node boxes"
5608-
connects_to = nodenames, --[[
5609-
^ Used for nodebox nodes with the type == "connected"
5610-
^ Specifies to what neighboring nodes connections will be drawn
5611-
^ e.g. `{"group:fence", "default:wood"}` or `"default:stone"` ]]
5690+
-- If player is inside node, this damage is caused
5691+
5692+
node_box = {type="regular"}, -- See "Node boxes"
5693+
5694+
connects_to = nodenames,
5695+
-- Used for nodebox nodes with the type == "connected".
5696+
-- Specifies to what neighboring nodes connections will be drawn.
5697+
-- e.g. `{"group:fence", "default:wood"}` or `"default:stone"`
5698+
56125699
connect_sides = { "top", "bottom", "front", "left", "back", "right" },
5613-
-- [[
5614-
^ Tells connected nodebox nodes to connect only to these sides of this
5615-
^ node. ]]
5700+
-- Tells connected nodebox nodes to connect only to these sides of this
5701+
-- node
5702+
56165703
mesh = "model",
5704+
56175705
selection_box = {
56185706
type = "fixed",
56195707
fixed = {
56205708
{-2 / 16, -0.5, -2 / 16, 2 / 16, 3 / 16, 2 / 16},
56215709
},
56225710
},
5623-
^ Custom selection box definition. Multiple boxes can be defined.
5624-
^ If drawtype "nodebox" is used and selection_box is nil, then node_box
5625-
^ definition is used for the selection box.
5711+
-- Custom selection box definition. Multiple boxes can be defined.
5712+
-- If "nodebox" drawtype is used and selection_box is nil, then node_box
5713+
-- definition is used for the selection box.
5714+
56265715
collision_box = {
56275716
type = "fixed",
56285717
fixed = {
56295718
{-2 / 16, -0.5, -2 / 16, 2 / 16, 3 / 16, 2 / 16},
56305719
},
56315720
},
5632-
^ Custom collision box definition. Multiple boxes can be defined.
5633-
^ If drawtype "nodebox" is used and collision_box is nil, then node_box
5634-
^ definition is used for the collision box.
5635-
^ For both of the above a box is defined as:
5636-
^ {xmin, ymin, zmin, xmax, ymax, zmax} in nodes from node center.
5721+
-- Custom collision box definition. Multiple boxes can be defined.
5722+
-- If "nodebox" drawtype is used and collision_box is nil, then node_box
5723+
-- definition is used for the collision box.
5724+
-- Both of the boxes above are defined as:
5725+
-- {xmin, ymin, zmin, xmax, ymax, zmax} in nodes from node center.
5726+
5727+
-- Support maps made in and before January 2012
56375728
legacy_facedir_simple = false,
5638-
^ Support maps made in and before January 2012.
56395729
legacy_wallmounted = false,
5640-
^ Support maps made in and before January 2012.
5641-
waving = 0, --[[
5642-
^ Valid for mesh, nodebox, plantlike, allfaces_optional nodes.
5643-
^ 1 - wave node like plants (top of node moves, bottom is fixed)
5644-
^ 2 - wave node like leaves (whole node moves side-to-side)
5645-
^ caveats: not all models will properly wave.
5646-
^ plantlike drawtype nodes can only wave like plants.
5647-
^ allfaces_optional drawtype nodes can only wave like leaves. --]]
5730+
5731+
waving = 0,
5732+
-- Valid for mesh, nodebox, plantlike, allfaces_optional nodes.
5733+
-- 1 - wave node like plants (top of node moves, bottom is fixed)
5734+
-- 2 - wave node like leaves (whole node moves side-to-side)
5735+
-- caveats: not all models will properly wave.
5736+
-- plantlike drawtype nodes can only wave like plants.
5737+
-- allfaces_optional drawtype nodes can only wave like leaves.
5738+
56485739
sounds = {
56495740
footstep = <SimpleSoundSpec>,
5650-
dig = <SimpleSoundSpec>, -- "__group" = group-based sound (default)
5741+
dig = <SimpleSoundSpec>, -- "__group" = group-based sound (default)
56515742
dug = <SimpleSoundSpec>,
56525743
place = <SimpleSoundSpec>,
56535744
place_failed = <SimpleSoundSpec>,
56545745
},
5746+
56555747
drop = "",
5656-
^ Name of dropped node when dug. Default is the node itself.
5657-
^ Alternatively:
5748+
-- Name of dropped node when dug. Default is the node itself.
5749+
-- Alternatively:
56585750
drop = {
5659-
max_items = 1, -- Maximum number of items to drop.
5660-
items = { -- Choose max_items randomly from this list.
5751+
-- Maximum number of items to drop
5752+
max_items = 1,
5753+
-- Choose max_items randomly from this list
5754+
items = {
56615755
{
5662-
items = {"foo:bar", "baz:frob"}, -- Items to drop.
5663-
rarity = 1, -- Probability of dropping is 1 / rarity.
5664-
inherit_color = true, -- To inherit palette color from the
5665-
node.
5756+
items = {"foo:bar", "baz:frob"}, -- Items to drop
5757+
rarity = 1, -- Probability of dropping is 1 / rarity
5758+
inherit_color = true, -- Inherit palette color from the node
56665759
},
56675760
},
56685761
},
56695762

5670-
on_construct = func(pos), --[[
5671-
^ Node constructor; called after adding node
5672-
^ Can set up metadata and stuff like that
5673-
^ Not called for bulk node placement (i.e. schematics and VoxelManip)
5674-
^ default: nil ]]
5675-
5676-
on_destruct = func(pos), --[[
5677-
^ Node destructor; called before removing node
5678-
^ Not called for bulk node placement (i.e. schematics and VoxelManip)
5679-
^ default: nil ]]
5680-
5681-
after_destruct = func(pos, oldnode), --[[
5682-
^ Node destructor; called after removing node
5683-
^ Not called for bulk node placement (i.e. schematics and VoxelManip)
5684-
^ default: nil ]]
5685-
5686-
on_flood = func(pos, oldnode, newnode), --[[
5687-
^ Called when a liquid (newnode) is about to flood oldnode, if
5688-
^ it has `floodable = true` in the nodedef. Not called for bulk
5689-
^ node placement (i.e. schematics and VoxelManip) or air nodes. If
5690-
^ return true the node is not flooded, but on_flood callback will
5691-
^ most likely be called over and over again every liquid update
5692-
^ interval. Default: nil.
5693-
^ Warning: making a liquid node 'floodable' will cause problems. ]]
5694-
5695-
preserve_metadata = func(pos, oldnode, oldmeta, drops) --[[
5696-
^ Called when oldnode is about be converted to an item, but before the
5697-
^ node is deleted from the world or the drops are added. This is
5698-
^ generally the result of either the node being dug or an attached node
5699-
^ becoming detached.
5700-
^ drops is a table of ItemStacks, so any metadata to be preserved can
5701-
^ be added directly to one or more of the dropped items. See
5702-
^ "ItemStackMetaRef".
5703-
^ default: nil ]]
5704-
5705-
after_place_node = func(pos, placer, itemstack, pointed_thing) --[[
5706-
^ Called after constructing node when node was placed using
5707-
^ minetest.item_place_node / minetest.place_node
5708-
^ If return true no item is taken from itemstack
5709-
^ `placer` may be any valid ObjectRef or nil
5710-
^ default: nil ]]
5711-
5712-
after_dig_node = func(pos, oldnode, oldmetadata, digger), --[[
5713-
^ oldmetadata is in table format
5714-
^ Called after destructing node when node was dug using
5715-
^ minetest.node_dig / minetest.dig_node
5716-
^ default: nil ]]
5717-
5718-
can_dig = function(pos, [player]) --[[
5719-
^ returns true if node can be dug, or false if not
5720-
^ default: nil ]]
5721-
5722-
on_punch = func(pos, node, puncher, pointed_thing), --[[
5723-
^ default: minetest.node_punch
5724-
^ By default: Calls minetest.register_on_punchnode callbacks ]]
5763+
on_construct = func(pos),
5764+
-- Node constructor; called after adding node.
5765+
-- Can set up metadata and stuff like that.
5766+
-- Not called for bulk node placement (i.e. schematics and VoxelManip).
5767+
-- default: nil
5768+
5769+
on_destruct = func(pos),
5770+
-- Node destructor; called before removing node.
5771+
-- Not called for bulk node placement.
5772+
-- default: nil
5773+
5774+
after_destruct = func(pos, oldnode),
5775+
-- Node destructor; called after removing node.
5776+
-- Not called for bulk node placement.
5777+
-- default: nil
5778+
5779+
on_flood = func(pos, oldnode, newnode),
5780+
-- Called when a liquid (newnode) is about to flood oldnode, if it has
5781+
-- `floodable = true` in the nodedef. Not called for bulk node placement
5782+
-- (i.e. schematics and VoxelManip) or air nodes. If return true the
5783+
-- node is not flooded, but on_flood callback will most likely be called
5784+
-- over and over again every liquid update interval.
5785+
-- Default: nil
5786+
-- Warning: making a liquid node 'floodable' will cause problems.
5787+
5788+
preserve_metadata = func(pos, oldnode, oldmeta, drops),
5789+
-- Called when oldnode is about be converted to an item, but before the
5790+
-- node is deleted from the world or the drops are added. This is
5791+
-- generally the result of either the node being dug or an attached node
5792+
-- becoming detached.
5793+
-- drops is a table of ItemStacks, so any metadata to be preserved can
5794+
-- be added directly to one or more of the dropped items. See
5795+
-- "ItemStackMetaRef".
5796+
-- default: nil
5797+
5798+
after_place_node = func(pos, placer, itemstack, pointed_thing),
5799+
-- Called after constructing node when node was placed using
5800+
-- minetest.item_place_node / minetest.place_node.
5801+
-- If return true no item is taken from itemstack.
5802+
-- `placer` may be any valid ObjectRef or nil.
5803+
-- default: nil
5804+
5805+
after_dig_node = func(pos, oldnode, oldmetadata, digger),
5806+
-- oldmetadata is in table format.
5807+
-- Called after destructing node when node was dug using
5808+
-- minetest.node_dig / minetest.dig_node.
5809+
-- default: nil
5810+
5811+
can_dig = function(pos, [player]),
5812+
5813+
on_punch = func(pos, node, puncher, pointed_thing),
5814+
-- Returns true if node can be dug, or false if not.
5815+
-- default: nil
5816+
-- default: minetest.node_punch
5817+
-- By default calls minetest.register_on_punchnode callbacks.
57255818

57265819
on_rightclick = func(pos, node, clicker, itemstack, pointed_thing),
5727-
--[[
5728-
^ default: nil
5729-
^ itemstack will hold clicker's wielded item
5730-
^ Shall return the leftover itemstack
5731-
^ Note: pointed_thing can be nil, if a mod calls this function
5732-
^ This function does not get triggered by clients <=0.4.16 if the
5733-
^ "formspec" node metadata field is set ]]
5734-
5735-
on_dig = func(pos, node, digger), --[[
5736-
^ default: minetest.node_dig
5737-
^ By default: checks privileges, wears out tool and removes node ]]
5738-
5739-
on_timer = function(pos,elapsed), --[[
5740-
^ default: nil
5741-
^ called by NodeTimers, see minetest.get_node_timer and NodeTimerRef
5742-
^ elapsed is the total time passed since the timer was started
5743-
^ return true to run the timer for another cycle with the same timeout
5744-
^ value. ]]
5745-
5746-
on_receive_fields = func(pos, formname, fields, sender), --[[
5747-
^ fields = {name1 = value1, name2 = value2, ...}
5748-
^ Called when an UI form (e.g. sign text input) returns data
5749-
^ default: nil ]]
5820+
-- default: nil
5821+
-- itemstack will hold clicker's wielded item.
5822+
-- Shall return the leftover itemstack.
5823+
-- Note: pointed_thing can be nil, if a mod calls this function.
5824+
-- This function does not get triggered by clients <=0.4.16 if the
5825+
-- "formspec" node metadata field is set.
5826+
5827+
on_dig = func(pos, node, digger),
5828+
-- default: minetest.node_dig
5829+
-- By default checks privileges, wears out tool and removes node.
5830+
5831+
on_timer = function(pos, elapsed),
5832+
-- default: nil
5833+
-- called by NodeTimers, see minetest.get_node_timer and NodeTimerRef.
5834+
-- elapsed is the total time passed since the timer was started.
5835+
-- return true to run the timer for another cycle with the same timeout
5836+
-- value.
5837+
5838+
on_receive_fields = func(pos, formname, fields, sender),
5839+
-- fields = {name1 = value1, name2 = value2, ...}
5840+
-- Called when an UI form (e.g. sign text input) returns data.
5841+
-- default: nil
57505842

57515843
allow_metadata_inventory_move = func(pos, from_list, from_index, to_list, to_index, count, player),
5752-
--[[
5753-
^ Called when a player wants to move items inside the inventory
5754-
^ Return value: number of items allowed to move ]]
5844+
-- Called when a player wants to move items inside the inventory.
5845+
-- Return value: number of items allowed to move.
57555846

57565847
allow_metadata_inventory_put = func(pos, listname, index, stack, player),
5757-
--[[
5758-
^ Called when a player wants to put something into the inventory
5759-
^ Return value: number of items allowed to put
5760-
^ Return value: -1: Allow and don't modify item count in inventory ]]
5848+
-- Called when a player wants to put something into the inventory.
5849+
-- Return value: number of items allowed to put.
5850+
-- Return value -1: Allow and don't modify item count in inventory.
57615851

57625852
allow_metadata_inventory_take = func(pos, listname, index, stack, player),
5763-
--[[
5764-
^ Called when a player wants to take something out of the inventory
5765-
^ Return value: number of items allowed to take
5766-
^ Return value: -1: Allow and don't modify item count in inventory ]]
5853+
-- Called when a player wants to take something out of the inventory.
5854+
-- Return value: number of items allowed to take.
5855+
-- Return value -1: Allow and don't modify item count in inventory.
57675856

57685857
on_metadata_inventory_move = func(pos, from_list, from_index, to_list, to_index, count, player),
57695858
on_metadata_inventory_put = func(pos, listname, index, stack, player),
57705859
on_metadata_inventory_take = func(pos, listname, index, stack, player),
5771-
--[[
5772-
^ Called after the actual action has happened, according to what was
5773-
^ allowed.
5774-
^ No return value ]]
5775-
5776-
on_blast = func(pos, intensity), --[[
5777-
^ intensity: 1.0 = mid range of regular TNT
5778-
^ If defined, called when an explosion touches the node, instead of
5779-
removing the node ]]
5860+
-- Called after the actual action has happened, according to what was
5861+
-- allowed.
5862+
-- No return value.
5863+
5864+
on_blast = func(pos, intensity),
5865+
-- intensity: 1.0 = mid range of regular TNT.
5866+
-- If defined, called when an explosion touches the node, instead of
5867+
-- removing the node.
57805868
}
57815869

57825870
Crafting recipes
@@ -5791,24 +5879,26 @@ Used by `minetest.register_craft`.
57915879
recipe = {
57925880
{'default:cobble', 'default:cobble', 'default:cobble'},
57935881
{'', 'default:stick', ''},
5794-
{'', 'default:stick', ''}, -- Also groups; e.g. 'group:crumbly'
5882+
{'', 'default:stick', ''}, -- Also groups; e.g. 'group:crumbly'
57955883
},
5796-
replacements = --[[<optional list of item pairs,
5797-
replace one input item with another item on crafting>]]
5884+
replacements = <list of item pairs>,
5885+
-- `replacements`: replace one input item with another item on crafting
5886+
-- (optional).
57985887
}
57995888

58005889
### Shapeless
58015890

58025891
{
5803-
type = "shapeless",
5804-
output = 'mushrooms:mushroom_stew',
5805-
recipe = {
5806-
"mushrooms:bowl",
5807-
"mushrooms:mushroom_brown",
5808-
"mushrooms:mushroom_red",
5809-
},
5810-
replacements = --[[<optional list of item pairs,
5811-
replace one input item with another item on crafting>]]
5892+
type = "shapeless",
5893+
output = 'mushrooms:mushroom_stew',
5894+
recipe = {
5895+
"mushrooms:bowl",
5896+
"mushrooms:mushroom_brown",
5897+
"mushrooms:mushroom_red",
5898+
},
5899+
replacements = <list of item pairs>,
5900+
-- `replacements`: replace one input item with another item on crafting
5901+
-- (optional).
58125902
}
58135903

58145904
### Tool repair
@@ -5840,34 +5930,43 @@ Ore definition
58405930

58415931
Used by `minetest.register_ore`.
58425932

5843-
See 'Ore types' section above for essential information.
5933+
See 'Ores' section above for essential information.
58445934

58455935
{
58465936
ore_type = "scatter",
5937+
58475938
ore = "default:stone_with_coal",
5939+
58485940
ore_param2 = 3,
5849-
-- ^ Facedir rotation. Default is 0 (unchanged rotation)
5941+
-- Facedir rotation. Default is 0 (unchanged rotation)
5942+
58505943
wherein = "default:stone",
5851-
-- ^ a list of nodenames is supported too
5944+
-- A list of nodenames is supported too
5945+
58525946
clust_scarcity = 8 * 8 * 8,
5853-
-- ^ Ore has a 1 out of clust_scarcity chance of spawning in a node
5854-
-- ^ If the desired average distance between ores is 'd', set this to
5855-
-- ^ d * d * d.
5947+
-- Ore has a 1 out of clust_scarcity chance of spawning in a node.
5948+
-- If the desired average distance between ores is 'd', set this to
5949+
-- d * d * d.
5950+
58565951
clust_num_ores = 8,
5857-
-- ^ Number of ores in a cluster
5952+
-- Number of ores in a cluster
5953+
58585954
clust_size = 3,
5859-
-- ^ Size of the bounding box of the cluster
5860-
-- ^ In this example, there is a 3 * 3 * 3 cluster where 8 out of the 27
5861-
-- ^ nodes are coal ore.
5955+
-- Size of the bounding box of the cluster.
5956+
-- In this example, there is a 3 * 3 * 3 cluster where 8 out of the 27
5957+
-- nodes are coal ore.
5958+
5959+
-- Lower and upper limits for ore
58625960
y_min = -31000,
58635961
y_max = 64,
5864-
-- ^ Lower and upper limits for ore.
5962+
58655963
flags = "",
5866-
-- ^ Attributes for this ore generation, see 'Ore attributes' section
5867-
-- ^ above.
5964+
-- Attributes for the ore generation, see 'Ore attributes' section above
5965+
58685966
noise_threshold = 0.5,
5869-
-- ^ If noise is above this threshold, ore is placed. Not needed for a
5870-
-- ^ uniform distribution.
5967+
-- If noise is above this threshold, ore is placed. Not needed for a
5968+
-- uniform distribution.
5969+
58715970
noise_params = {
58725971
offset = 0,
58735972
scale = 1,
@@ -5876,22 +5975,27 @@ See 'Ore types' section above for essential information.
58765975
octaves = 3,
58775976
persist = 0.7
58785977
},
5879-
-- ^ NoiseParams structure describing one of the perlin noises used for
5880-
-- ^ ore distribution.
5881-
-- ^ Needed by "sheet", "puff", "blob" and "vein" ores.
5882-
-- ^ Omit from "scatter" ore for a uniform ore distribution.
5883-
-- ^ Omit from "stratum ore for a simple horizontal strata from y_min to
5884-
-- ^ y_max.
5885-
biomes = {"desert", "rainforest"}
5886-
-- ^ List of biomes in which this decoration occurs.
5887-
-- ^ Occurs in all biomes if this is omitted, and ignored if the Mapgen
5888-
-- ^ being used does not support biomes.
5889-
-- ^ Can be a list of (or a single) biome names, IDs, or definitions.
5978+
-- NoiseParams structure describing one of the perlin noises used for
5979+
-- ore distribution.
5980+
-- Needed by "sheet", "puff", "blob" and "vein" ores.
5981+
-- Omit from "scatter" ore for a uniform ore distribution.
5982+
-- Omit from "stratum" ore for a simple horizontal strata from y_min to
5983+
-- y_max.
5984+
5985+
biomes = {"desert", "rainforest"},
5986+
-- List of biomes in which this ore occurs.
5987+
-- Occurs in all biomes if this is omitted, and ignored if the Mapgen
5988+
-- being used does not support biomes.
5989+
-- Can be a list of (or a single) biome names, IDs, or definitions.
5990+
5991+
-- Type-specific parameters
5992+
5993+
-- sheet
58905994
column_height_min = 1,
58915995
column_height_max = 16,
58925996
column_midpoint_factor = 0.5,
5893-
-- ^ See 'Ore types' section above.
5894-
-- ^ The above 3 parameters are only valid for "sheet" ore.
5997+
5998+
-- puff
58955999
np_puff_top = {
58966000
offset = 4,
58976001
scale = 2,
@@ -5908,11 +6012,11 @@ See 'Ore types' section above for essential information.
59086012
octaves = 3,
59096013
persist = 0.7
59106014
},
5911-
-- ^ See 'Ore types' section above.
5912-
-- ^ The above 2 parameters are only valid for "puff" ore.
6015+
6016+
-- vein
59136017
random_factor = 1.0,
5914-
-- ^ See 'Ore types' section above.
5915-
-- ^ Only valid for "vein" ore.
6018+
6019+
-- stratum
59166020
np_stratum_thickness = {
59176021
offset = 8,
59186022
scale = 4,
@@ -5922,8 +6026,6 @@ See 'Ore types' section above for essential information.
59226026
persist = 0.7
59236027
},
59246028
stratum_thickness = 8,
5925-
-- ^ See 'Ore types' section above.
5926-
-- ^ The above 2 parameters are only valid for "stratum" ore.
59276029
}
59286030

59296031
Biome definition
@@ -5933,86 +6035,105 @@ Used by `minetest.register_biome`.
59336035

59346036
{
59356037
name = "tundra",
6038+
59366039
node_dust = "default:snow",
5937-
-- ^ Node dropped onto upper surface after all else is generated.
6040+
-- Node dropped onto upper surface after all else is generated
6041+
59386042
node_top = "default:dirt_with_snow",
59396043
depth_top = 1,
5940-
-- ^ Node forming surface layer of biome and thickness of this layer.
6044+
-- Node forming surface layer of biome and thickness of this layer
6045+
59416046
node_filler = "default:permafrost",
59426047
depth_filler = 3,
5943-
-- ^ Node forming lower layer of biome and thickness of this layer.
6048+
-- Node forming lower layer of biome and thickness of this layer
6049+
59446050
node_stone = "default:bluestone",
5945-
-- ^ Node that replaces all stone nodes between roughly y_min and y_max.
6051+
-- Node that replaces all stone nodes between roughly y_min and y_max.
6052+
59466053
node_water_top = "default:ice",
59476054
depth_water_top = 10,
5948-
-- ^ Node forming a surface layer in seawater with the defined thickness.
6055+
-- Node forming a surface layer in seawater with the defined thickness
6056+
59496057
node_water = "",
5950-
-- ^ Node that replaces all seawater nodes not in the defined surface
5951-
-- ^ layer.
6058+
-- Node that replaces all seawater nodes not in the surface layer
6059+
59526060
node_river_water = "default:ice",
5953-
-- ^ Node that replaces river water in mapgens that use
5954-
-- ^ default:river_water.
6061+
-- Node that replaces river water in mapgens that use
6062+
-- default:river_water
6063+
59556064
node_riverbed = "default:gravel",
59566065
depth_riverbed = 2,
5957-
-- ^ Node placed under river water and thickness of this layer.
6066+
-- Node placed under river water and thickness of this layer
6067+
59586068
node_cave_liquid = "default:water_source",
5959-
-- ^ Nodes placed as a blob of liquid in 50% of large caves.
5960-
-- ^ If absent, cave liquids fall back to classic behaviour of lava or
5961-
-- ^ water distributed according to a hardcoded 3D noise.
6069+
-- Nodes placed as a blob of liquid in 50% of large caves.
6070+
-- If absent, cave liquids fall back to classic behaviour of lava or
6071+
-- water distributed according to a hardcoded 3D noise.
6072+
59626073
node_dungeon = "default:cobble",
5963-
-- ^ Node used for primary dungeon structure.
5964-
-- ^ If absent, dungeon materials fall back to classic behaviour.
5965-
-- ^ If present, the following two nodes are also used.
6074+
-- Node used for primary dungeon structure.
6075+
-- If absent, dungeon materials fall back to classic behaviour.
6076+
-- If present, the following two nodes are also used.
6077+
59666078
node_dungeon_alt = "default:mossycobble",
5967-
-- ^ Node used for randomly-distributed alternative structure nodes.
5968-
-- ^ If alternative structure nodes are not wanted leave this absent for
5969-
-- ^ performance reasons.
6079+
-- Node used for randomly-distributed alternative structure nodes.
6080+
-- If alternative structure nodes are not wanted leave this absent for
6081+
-- performance reasons.
6082+
59706083
node_dungeon_stair = "stairs:stair_cobble",
5971-
-- ^ Node used for dungeon stairs.
5972-
-- ^ If absent, stairs fall back to 'node_dungeon'.
6084+
-- Node used for dungeon stairs.
6085+
-- If absent, stairs fall back to 'node_dungeon'.
6086+
59736087
y_max = 31000,
59746088
y_min = 1,
5975-
-- ^ Upper and lower limits for biome.
5976-
-- ^ Alternatively you can use xyz limits as shown below.
6089+
-- Upper and lower limits for biome.
6090+
-- Alternatively you can use xyz limits as shown below.
6091+
59776092
max_pos = {x = 31000, y = 128, z = 31000},
59786093
min_pos = {x = -31000, y = 9, z = -31000},
5979-
-- ^ xyz limits for biome, an alternative to using 'y_min' and 'y_max'.
5980-
-- ^ Biome is limited to a cuboid defined by these positions.
5981-
-- ^ Any x, y or z field left undefined defaults to -31000 in 'min_pos' or
5982-
-- ^ 31000 in 'max_pos'.
6094+
-- xyz limits for biome, an alternative to using 'y_min' and 'y_max'.
6095+
-- Biome is limited to a cuboid defined by these positions.
6096+
-- Any x, y or z field left undefined defaults to -31000 in 'min_pos' or
6097+
-- 31000 in 'max_pos'.
6098+
59836099
vertical_blend = 8,
5984-
-- ^ Vertical distance in nodes above 'y_max' over which the biome will
5985-
-- ^ blend with the biome above.
5986-
-- ^ Set to 0 for no vertical blend. Defaults to 0.
6100+
-- Vertical distance in nodes above 'y_max' over which the biome will
6101+
-- blend with the biome above.
6102+
-- Set to 0 for no vertical blend. Defaults to 0.
6103+
59876104
heat_point = 0,
59886105
humidity_point = 50,
5989-
-- ^ Characteristic temperature and humidity for the biome.
5990-
-- ^ These values create 'biome points' on a voronoi diagram with heat and
5991-
-- ^ humidity as axes. The resulting voronoi cells determine the
5992-
-- ^ distribution of the biomes.
5993-
-- ^ Heat and humidity have average values of 50, vary mostly between
5994-
-- ^ 0 and 100 but can exceed these values.
6106+
-- Characteristic temperature and humidity for the biome.
6107+
-- These values create 'biome points' on a voronoi diagram with heat and
6108+
-- humidity as axes. The resulting voronoi cells determine the
6109+
-- distribution of the biomes.
6110+
-- Heat and humidity have average values of 50, vary mostly between
6111+
-- 0 and 100 but can exceed these values.
59956112
}
59966113

59976114
Decoration definition
59986115
---------------------
59996116

6000-
Used by `minetest.register_decoration`.
6117+
See "Decoration types". Used by `minetest.register_decoration`.
60016118

60026119
{
6003-
deco_type = "simple", -- See "Decoration types"
6120+
deco_type = "simple",
6121+
60046122
place_on = "default:dirt_with_grass",
6005-
-- ^ Node (or list of nodes) that the decoration can be placed on
6123+
-- Node (or list of nodes) that the decoration can be placed on
6124+
60066125
sidelen = 8,
6007-
-- ^ Size of the square divisions of the mapchunk being generated.
6008-
-- ^ Determines the resolution of noise variation if used.
6009-
-- ^ If the chunk size is not evenly divisible by sidelen, sidelen is made
6010-
-- ^ equal to the chunk size.
6126+
-- Size of the square divisions of the mapchunk being generated.
6127+
-- Determines the resolution of noise variation if used.
6128+
-- If the chunk size is not evenly divisible by sidelen, sidelen is made
6129+
-- equal to the chunk size.
6130+
60116131
fill_ratio = 0.02,
6012-
-- ^ The value determines 'decorations per surface node'.
6013-
-- ^ Used only if noise_params is not specified.
6014-
-- ^ If >= 10.0 complete coverage is enabled and decoration placement uses
6015-
-- ^ a different and much faster method.
6132+
-- The value determines 'decorations per surface node'.
6133+
-- Used only if noise_params is not specified.
6134+
-- If >= 10.0 complete coverage is enabled and decoration placement uses
6135+
-- a different and much faster method.
6136+
60166137
noise_params = {
60176138
offset = 0,
60186139
scale = 0.45,
@@ -6023,82 +6144,93 @@ Used by `minetest.register_decoration`.
60236144
lacunarity = 2.0,
60246145
flags = "absvalue"
60256146
},
6026-
-- ^ NoiseParams structure describing the perlin noise used for decoration
6027-
-- ^ distribution.
6028-
-- ^ A noise value is calculated for each square division and determines
6029-
-- ^ 'decorations per surface node' within each division.
6030-
-- ^ If the noise value >= 10.0 complete coverage is enabled and decoration
6031-
-- ^ placement uses a different and much faster method.
6147+
-- NoiseParams structure describing the perlin noise used for decoration
6148+
-- distribution.
6149+
-- A noise value is calculated for each square division and determines
6150+
-- 'decorations per surface node' within each division.
6151+
-- If the noise value >= 10.0 complete coverage is enabled and
6152+
-- decoration placement uses a different and much faster method.
6153+
60326154
biomes = {"Oceanside", "Hills", "Plains"},
6033-
-- ^ List of biomes in which this decoration occurs. Occurs in all biomes
6034-
-- ^ if this is omitted, and ignored if the Mapgen being used does not
6035-
-- ^ support biomes.
6036-
-- ^ Can be a list of (or a single) biome names, IDs, or definitions.
6037-
y_min = -31000
6038-
y_max = 31000
6039-
-- ^ Lower and upper limits for decoration.
6040-
-- ^ These parameters refer to the Y co-ordinate of the 'place_on' node.
6155+
-- List of biomes in which this decoration occurs. Occurs in all biomes
6156+
-- if this is omitted, and ignored if the Mapgen being used does not
6157+
-- support biomes.
6158+
-- Can be a list of (or a single) biome names, IDs, or definitions.
6159+
6160+
y_min = -31000,
6161+
y_max = 31000,
6162+
-- Lower and upper limits for decoration.
6163+
-- These parameters refer to the Y co-ordinate of the 'place_on' node.
6164+
60416165
spawn_by = "default:water",
6042-
-- ^ Node (or list of nodes) that the decoration only spawns next to.
6043-
-- ^ Checks two horizontal planes of 8 neighbouring nodes (including
6044-
-- ^ diagonal neighbours), one plane level with the 'place_on' node and a
6045-
-- ^ plane one node above that.
6166+
-- Node (or list of nodes) that the decoration only spawns next to.
6167+
-- Checks two horizontal planes of 8 neighbouring nodes (including
6168+
-- diagonal neighbours), one plane level with the 'place_on' node and a
6169+
-- plane one node above that.
6170+
60466171
num_spawn_by = 1,
6047-
-- ^ Number of spawn_by nodes that must be surrounding the decoration
6048-
-- ^ position to occur.
6049-
-- ^ If absent or -1, decorations occur next to any nodes.
6172+
-- Number of spawn_by nodes that must be surrounding the decoration
6173+
-- position to occur.
6174+
-- If absent or -1, decorations occur next to any nodes.
6175+
60506176
flags = "liquid_surface, force_placement, all_floors, all_ceilings",
6051-
-- ^ Flags for all decoration types.
6052-
-- ^ "liquid_surface": Instead of placement on the highest solid surface
6053-
-- ^ in a mapchunk column, placement is on the highest liquid surface.
6054-
-- ^ Placement is disabled if solid nodes are found above the liquid
6055-
-- ^ surface.
6056-
-- ^ "force_placement": Nodes other than "air" and "ignore" are replaced
6057-
-- ^ by the decoration.
6058-
-- ^ "all_floors", "all_ceilings": Instead of placement on the highest
6059-
-- ^ surface in a mapchunk the decoration is placed on all floor and/or
6060-
-- ^ ceiling surfaces, for example in caves and dungeons.
6061-
-- ^ Ceiling decorations act as an inversion of floor decorations so the
6062-
-- ^ effect of 'place_offset_y' is inverted.
6063-
-- ^ Y-slice probabilities do not function correctly for ceiling
6064-
-- ^ schematic decorations as the behaviour is unchanged.
6065-
-- ^ If a single decoration registration has both flags the floor and
6066-
-- ^ ceiling decorations will be aligned vertically.
6177+
-- Flags for all decoration types.
6178+
-- "liquid_surface": Instead of placement on the highest solid surface
6179+
-- in a mapchunk column, placement is on the highest liquid surface.
6180+
-- Placement is disabled if solid nodes are found above the liquid
6181+
-- surface.
6182+
-- "force_placement": Nodes other than "air" and "ignore" are replaced
6183+
-- by the decoration.
6184+
-- "all_floors", "all_ceilings": Instead of placement on the highest
6185+
-- surface in a mapchunk the decoration is placed on all floor and/or
6186+
-- ceiling surfaces, for example in caves and dungeons.
6187+
-- Ceiling decorations act as an inversion of floor decorations so the
6188+
-- effect of 'place_offset_y' is inverted.
6189+
-- Y-slice probabilities do not function correctly for ceiling
6190+
-- schematic decorations as the behaviour is unchanged.
6191+
-- If a single decoration registration has both flags the floor and
6192+
-- ceiling decorations will be aligned vertically.
60676193

60686194
----- Simple-type parameters
6195+
60696196
decoration = "default:grass",
6070-
-- ^ The node name used as the decoration.
6071-
-- ^ If instead a list of strings, a randomly selected node from the list
6072-
-- ^ is placed as the decoration.
6197+
-- The node name used as the decoration.
6198+
-- If instead a list of strings, a randomly selected node from the list
6199+
-- is placed as the decoration.
6200+
60736201
height = 1,
6074-
-- ^ Decoration height in nodes.
6075-
-- ^ If height_max is not 0, this is the lower limit of a randomly
6076-
-- ^ selected height.
6202+
-- Decoration height in nodes.
6203+
-- If height_max is not 0, this is the lower limit of a randomly
6204+
-- selected height.
6205+
60776206
height_max = 0,
6078-
-- ^ Upper limit of the randomly selected height.
6079-
-- ^ If absent, the parameter 'height' is used as a constant.
6207+
-- Upper limit of the randomly selected height.
6208+
-- If absent, the parameter 'height' is used as a constant.
6209+
60806210
param2 = 0,
6081-
-- ^ Param2 value of decoration nodes.
6082-
-- ^ If param2_max is not 0, this is the lower limit of a randomly
6083-
-- ^ selected param2.
6211+
-- Param2 value of decoration nodes.
6212+
-- If param2_max is not 0, this is the lower limit of a randomly
6213+
-- selected param2.
6214+
60846215
param2_max = 0,
6085-
-- ^ Upper limit of the randomly selected param2.
6086-
-- ^ If absent, the parameter 'param2' is used as a constant.
6216+
-- Upper limit of the randomly selected param2.
6217+
-- If absent, the parameter 'param2' is used as a constant.
6218+
60876219
place_offset_y = 0,
6088-
-- ^ Y offset of the decoration base node relative to the standard base
6089-
-- ^ node position.
6090-
-- ^ Can be positive or negative. Default is 0.
6091-
-- ^ Effect is inverted for "all_ceilings" decorations.
6092-
-- ^ Ignored by 'y_min', 'y_max' and 'spawn_by' checks, which always refer
6093-
-- ^ to the 'place_on' node.
6220+
-- Y offset of the decoration base node relative to the standard base
6221+
-- node position.
6222+
-- Can be positive or negative. Default is 0.
6223+
-- Effect is inverted for "all_ceilings" decorations.
6224+
-- Ignored by 'y_min', 'y_max' and 'spawn_by' checks, which always refer
6225+
-- to the 'place_on' node.
60946226

60956227
----- Schematic-type parameters
6228+
60966229
schematic = "foobar.mts",
6097-
-- ^ If schematic is a string, it is the filepath relative to the current
6098-
-- ^ working directory of the specified Minetest schematic file.
6099-
-- ^ - OR -, could be the ID of a previously registered schematic
6100-
-- ^ - OR -, could instead be a table containing two mandatory fields,
6101-
-- ^ size and data, and an optional table yslice_prob:
6230+
-- If schematic is a string, it is the filepath relative to the current
6231+
-- working directory of the specified Minetest schematic file.
6232+
-- Could also be the ID of a previously registered schematic.
6233+
61026234
schematic = {
61036235
size = {x = 4, y = 6, z = 4},
61046236
data = {
@@ -6113,20 +6245,26 @@ Used by `minetest.register_decoration`.
61136245
...
61146246
},
61156247
},
6116-
-- ^ See 'Schematic specifier' for details.
6248+
-- Alternative schematic specification by supplying a table. The fields
6249+
-- size and data are mandatory whereas yslice_prob is optional.
6250+
-- See 'Schematic specifier' for details.
6251+
61176252
replacements = {["oldname"] = "convert_to", ...},
6253+
61186254
flags = "place_center_x, place_center_y, place_center_z",
6119-
-- ^ Flags for schematic decorations. See 'Schematic attributes'.
6255+
-- Flags for schematic decorations. See 'Schematic attributes'.
6256+
61206257
rotation = "90",
6121-
-- ^ Rotation can be "0", "90", "180", "270", or "random".
6258+
-- Rotation can be "0", "90", "180", "270", or "random"
6259+
61226260
place_offset_y = 0,
6123-
-- ^ If the flag 'place_center_y' is set this parameter is ignored.
6124-
-- ^ Y offset of the schematic base node layer relative to the 'place_on'
6125-
-- ^ node.
6126-
-- ^ Can be positive or negative. Default is 0.
6127-
-- ^ Effect is inverted for "all_ceilings" decorations.
6128-
-- ^ Ignored by 'y_min', 'y_max' and 'spawn_by' checks, which always refer
6129-
-- ^ to the 'place_on' node.
6261+
-- If the flag 'place_center_y' is set this parameter is ignored.
6262+
-- Y offset of the schematic base node layer relative to the 'place_on'
6263+
-- node.
6264+
-- Can be positive or negative. Default is 0.
6265+
-- Effect is inverted for "all_ceilings" decorations.
6266+
-- Ignored by 'y_min', 'y_max' and 'spawn_by' checks, which always refer
6267+
-- to the 'place_on' node.
61306268
}
61316269

61326270
Chat command definition
@@ -6135,12 +6273,14 @@ Chat command definition
61356273
Used by `minetest.register_chatcommand`.
61366274

61376275
{
6138-
params = "<name> <privilege>", -- Short parameter description
6139-
description = "Remove privilege from player", -- Full description
6140-
privs = {privs=true}, -- Require the "privs" privilege to run
6141-
func = function(name, param), -- Called when command is run.
6142-
-- Returns boolean success and text
6143-
-- output.
6276+
params = "<name> <privilege>", -- Short parameter description
6277+
6278+
description = "Remove privilege from player", -- Full description
6279+
6280+
privs = {privs=true}, -- Require the "privs" privilege to run
6281+
6282+
func = function(name, param),
6283+
-- Called when command is run. Returns boolean success and text output.
61446284
}
61456285

61466286
Note that in params, use of symbols is as follows:
@@ -6162,52 +6302,61 @@ Used by `minetest.create_detached_inventory`.
61626302

61636303
{
61646304
allow_move = func(inv, from_list, from_index, to_list, to_index, count, player),
6165-
-- ^ Called when a player wants to move items inside the inventory
6166-
-- ^ Return value: number of items allowed to move
6305+
-- Called when a player wants to move items inside the inventory.
6306+
-- Return value: number of items allowed to move.
61676307

61686308
allow_put = func(inv, listname, index, stack, player),
6169-
-- ^ Called when a player wants to put something into the inventory
6170-
-- ^ Return value: number of items allowed to put
6171-
-- ^ Return value: -1: Allow and don't modify item count in inventory
6309+
-- Called when a player wants to put something into the inventory.
6310+
-- Return value: number of items allowed to put.
6311+
-- Return value -1: Allow and don't modify item count in inventory.
61726312

61736313
allow_take = func(inv, listname, index, stack, player),
6174-
-- ^ Called when a player wants to take something out of the inventory
6175-
-- ^ Return value: number of items allowed to take
6176-
-- ^ Return value: -1: Allow and don't modify item count in inventory
6314+
-- Called when a player wants to take something out of the inventory.
6315+
-- Return value: number of items allowed to take.
6316+
-- Return value -1: Allow and don't modify item count in inventory.
61776317

61786318
on_move = func(inv, from_list, from_index, to_list, to_index, count, player),
61796319
on_put = func(inv, listname, index, stack, player),
61806320
on_take = func(inv, listname, index, stack, player),
6181-
-- ^ Called after the actual action has happened, according to what was
6182-
-- ^ allowed.
6183-
-- ^ No return value
6321+
-- Called after the actual action has happened, according to what was
6322+
-- allowed.
6323+
-- No return value.
61846324
}
61856325

61866326
HUD Definition
61876327
--------------
61886328

6329+
See "HUD" section.
6330+
61896331
Used by `Player:hud_add`. Returned by `Player:hud_get`.
61906332

61916333
{
6192-
hud_elem_type = "image", -- see HUD element types
6193-
-- ^ type of HUD element, can be either of "image", "text", "statbar",
6194-
"inventory".
6334+
hud_elem_type = "image", -- See HUD element types
6335+
-- Type of element, can be "image", "text", "statbar", or "inventory"
6336+
61956337
position = {x=0.5, y=0.5},
6196-
-- ^ Left corner position of element
6338+
-- Left corner position of element
6339+
61976340
name = "<name>",
6341+
61986342
scale = {x = 2, y = 2},
6343+
61996344
text = "<text>",
6345+
62006346
number = 2,
6347+
62016348
item = 3,
6202-
-- ^ Selected item in inventory. 0 for no item selected.
6349+
-- Selected item in inventory. 0 for no item selected.
6350+
62036351
direction = 0,
6204-
-- ^ Direction: 0: left-right, 1: right-left, 2: top-bottom, 3: bottom-top
6352+
-- Direction: 0: left-right, 1: right-left, 2: top-bottom, 3: bottom-top
6353+
62056354
alignment = {x=0, y=0},
6206-
-- ^ See "HUD Element Types"
6355+
62076356
offset = {x=0, y=0},
6208-
-- ^ See "HUD Element Types"
6357+
62096358
size = { x=100, y=100 },
6210-
-- ^ Size of element in pixels
6359+
-- Size of element in pixels
62116360
}
62126361

62136362
Particle definition
@@ -6219,26 +6368,34 @@ Used by `minetest.add_particle`.
62196368
pos = {x=0, y=0, z=0},
62206369
velocity = {x=0, y=0, z=0},
62216370
acceleration = {x=0, y=0, z=0},
6222-
-- ^ Spawn particle at pos with velocity and acceleration
6371+
-- Spawn particle at pos with velocity and acceleration
6372+
62236373
expirationtime = 1,
6224-
-- ^ Disappears after expirationtime seconds
6374+
-- Disappears after expirationtime seconds
6375+
62256376
size = 1,
6377+
62266378
collisiondetection = false,
6227-
-- ^ collisiondetection: if true collides with physical objects
6379+
-- If true collides with physical objects
6380+
62286381
collision_removal = false,
6229-
-- ^ collision_removal: if true then particle is removed when it collides,
6230-
-- ^ requires collisiondetection = true to have any effect
6382+
-- If true particle is removed when it collides.
6383+
-- Requires collisiondetection = true to have any effect.
6384+
62316385
vertical = false,
6232-
-- ^ vertical: if true faces player using y axis only
6386+
-- If true faces player using y axis only
6387+
62336388
texture = "image.png",
6234-
-- ^ Uses texture (string)
6389+
62356390
playername = "singleplayer",
6236-
-- ^ Optional, if specified spawns particle only on the player's client
6391+
-- Optional, if specified spawns particle only on the player's client
6392+
62376393
animation = {Tile Animation definition},
6238-
-- ^ Optional, specifies how to animate the particle texture
6394+
-- Optional, specifies how to animate the particle texture
6395+
62396396
glow = 0
6240-
-- ^ Optional, specify particle self-luminescence in darkness.
6241-
-- ^ Values 0-14.
6397+
-- Optional, specify particle self-luminescence in darkness.
6398+
-- Values 0-14.
62426399
}
62436400

62446401

@@ -6249,9 +6406,11 @@ Used by `minetest.add_particlespawner`.
62496406

62506407
{
62516408
amount = 1,
6409+
62526410
time = 1,
6253-
-- ^ If time is 0 has infinite lifespan and spawns the amount on a
6254-
-- ^ per-second basis.
6411+
-- If time is 0 has infinite lifespan and spawns the amount on a
6412+
-- per-second basis.
6413+
62556414
minpos = {x=0, y=0, z=0},
62566415
maxpos = {x=0, y=0, z=0},
62576416
minvel = {x=0, y=0, z=0},
@@ -6262,30 +6421,34 @@ Used by `minetest.add_particlespawner`.
62626421
maxexptime = 1,
62636422
minsize = 1,
62646423
maxsize = 1,
6265-
-- ^ The particle's properties are random values in between the bounds:
6266-
-- ^ minpos/maxpos, minvel/maxvel (velocity),
6267-
-- ^ minacc/maxacc (acceleration), minsize/maxsize,
6268-
-- ^ minexptime/maxexptime (expirationtime).
6424+
-- The particle's properties are random values in between the bounds
6425+
-- pos, velocity, acceleration, expirationtime, size
6426+
62696427
collisiondetection = false,
6270-
-- ^ collisiondetection: if true uses collision detection
6428+
-- If true collides with physical objects
6429+
62716430
collision_removal = false,
6272-
-- ^ collision_removal: if true then particle is removed when it collides,
6273-
-- ^ requires collisiondetection = true to have any effect
6431+
-- If true particle is removed when it collides.
6432+
-- Requires collisiondetection = true to have any effect.
6433+
62746434
attached = ObjectRef,
6275-
-- ^ attached: if defined, particle positions, velocities and
6276-
-- ^ accelerations are relative to this object's position and yaw.
6435+
-- If defined, particle positions, velocities and accelerations are
6436+
-- relative to this object's position and yaw
6437+
62776438
vertical = false,
6278-
-- ^ vertical: if true faces player using y axis only
6439+
-- If true faces player using y axis only
6440+
62796441
texture = "image.png",
6280-
-- ^ Uses texture (string)
6281-
playername = "singleplayer"
6282-
-- ^ Playername is optional, if specified spawns particle only on the
6283-
-- ^ player's client.
6442+
6443+
playername = "singleplayer",
6444+
-- Optional, if specified spawns particle only on the player's client
6445+
62846446
animation = {Tile Animation definition},
6285-
-- ^ Optional, specifies how to animate the particle texture
6447+
-- Optional, specifies how to animate the particle texture
6448+
62866449
glow = 0
6287-
-- ^ Optional, specify particle self-luminescence in darkness.
6288-
-- ^ Values 0-14.
6450+
-- Optional, specify particle self-luminescence in darkness.
6451+
-- Values 0-14.
62896452
}
62906453

62916454
`HTTPRequest` definition
@@ -6295,23 +6458,28 @@ Used by `HTTPApiTable.fetch` and `HTTPApiTable.fetch_async`.
62956458

62966459
{
62976460
url = "http://example.org",
6461+
62986462
timeout = 10,
6299-
-- ^ Timeout for connection in seconds. Default is 3 seconds.
6463+
-- Timeout for connection in seconds. Default is 3 seconds.
6464+
63006465
post_data = "Raw POST request data string" OR {field1 = "data1", field2 = "data2"},
6301-
-- ^ Optional, if specified a POST request with post_data is performed.
6302-
-- ^ Accepts both a string and a table. If a table is specified, encodes
6303-
-- ^ table as x-www-form-urlencoded key-value pairs.
6304-
-- ^ If post_data ist not specified, a GET request is performed instead.
6466+
-- Optional, if specified a POST request with post_data is performed.
6467+
-- Accepts both a string and a table. If a table is specified, encodes
6468+
-- table as x-www-form-urlencoded key-value pairs.
6469+
-- If post_data is not specified, a GET request is performed instead.
6470+
63056471
user_agent = "ExampleUserAgent",
6306-
-- ^ Optional, if specified replaces the default minetest user agent with
6307-
-- ^ given string.
6472+
-- Optional, if specified replaces the default minetest user agent with
6473+
-- given string
6474+
63086475
extra_headers = { "Accept-Language: en-us", "Accept-Charset: utf-8" },
6309-
-- ^ Optional, if specified adds additional headers to the HTTP request.
6310-
-- ^ You must make sure that the header strings follow HTTP specification
6311-
-- ^ ("Key: Value").
6476+
-- Optional, if specified adds additional headers to the HTTP request.
6477+
-- You must make sure that the header strings follow HTTP specification
6478+
-- ("Key: Value").
6479+
63126480
multipart = boolean
6313-
-- ^ Optional, if true performs a multipart HTTP request.
6314-
-- ^ Default is false.
6481+
-- Optional, if true performs a multipart HTTP request.
6482+
-- Default is false.
63156483
}
63166484

63176485
`HTTPRequestResult` definition
@@ -6322,14 +6490,18 @@ Passed to `HTTPApiTable.fetch` callback. Returned by
63226490

63236491
{
63246492
completed = true,
6325-
-- ^ If true, the request has finished (either succeeded, failed or timed
6326-
out).
6493+
-- If true, the request has finished (either succeeded, failed or timed
6494+
-- out)
6495+
63276496
succeeded = true,
6328-
-- ^ If true, the request was successful
6497+
-- If true, the request was successful
6498+
63296499
timeout = false,
6330-
-- ^ If true, the request timed out
6500+
-- If true, the request timed out
6501+
63316502
code = 200,
6332-
-- ^ HTTP status code
6503+
-- HTTP status code
6504+
63336505
data = "response"
63346506
}
63356507

@@ -6340,30 +6512,37 @@ Used by `minetest.register_authentication_handler`.
63406512

63416513
{
63426514
get_auth = func(name),
6343-
-- ^ Get authentication data for existing player `name` (`nil` if player
6344-
doesn't exist).
6345-
-- ^ returns following structure:
6346-
-- ^ `{password=<string>, privileges=<table>, last_login=<number or nil>}`
6515+
-- Get authentication data for existing player `name` (`nil` if player
6516+
-- doesn't exist).
6517+
-- Returns following structure:
6518+
-- `{password=<string>, privileges=<table>, last_login=<number or nil>}`
6519+
63476520
create_auth = func(name, password),
6348-
-- ^ Create new auth data for player `name`
6349-
-- ^ Note that `password` is not plain-text but an arbitrary
6350-
-- ^ representation decided by the engine
6521+
-- Create new auth data for player `name`.
6522+
-- Note that `password` is not plain-text but an arbitrary
6523+
-- representation decided by the engine.
6524+
63516525
delete_auth = func(name),
6352-
-- ^ Delete auth data of player `name`, returns boolean indicating success
6353-
-- ^ (false if player nonexistant).
6526+
-- Delete auth data of player `name`.
6527+
-- Returns boolean indicating success (false if player is nonexistent).
6528+
63546529
set_password = func(name, password),
6355-
-- ^ Set password of player `name` to `password`
6356-
Auth data should be created if not present
6530+
-- Set password of player `name` to `password`.
6531+
-- Auth data should be created if not present.
6532+
63576533
set_privileges = func(name, privileges),
6358-
-- ^ Set privileges of player `name`
6359-
-- ^ `privileges` is in table form, auth data should be created if not
6360-
-- ^ present.
6534+
-- Set privileges of player `name`.
6535+
-- `privileges` is in table form, auth data should be created if not
6536+
-- present.
6537+
63616538
reload = func(),
6362-
-- ^ Reload authentication data from the storage location
6363-
-- ^ Returns boolean indicating success
6539+
-- Reload authentication data from the storage location.
6540+
-- Returns boolean indicating success.
6541+
63646542
record_login = func(name),
6365-
-- ^ Called when player joins, used for keeping track of last_login
6543+
-- Called when player joins, used for keeping track of last_login
6544+
63666545
iterate = func(),
6367-
-- ^ Returns an iterator (use with `for` loops) for all player names
6368-
-- ^ currently in the auth database.
6546+
-- Returns an iterator (use with `for` loops) for all player names
6547+
-- currently in the auth database
63696548
}

0 commit comments

Comments
 (0)
Please sign in to comment.