@@ -5176,105 +5176,134 @@ Definition tables
5176
5176
Object properties
5177
5177
-----------------
5178
5178
5179
- Used by `ObjectRef` methods.
5179
+ Used by `ObjectRef` methods. Part of an Entity definition.
5180
5180
5181
5181
{
5182
5182
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
+
5184
5185
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
+
5186
5188
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
+
5193
5196
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
+
5196
5200
physical = true,
5201
+
5197
5202
collide_with_objects = true,
5198
- -- ^ Collide with other objects if physical = true.
5203
+ -- Collide with other objects if physical = true
5204
+
5199
5205
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
5201
5208
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
+
5205
5213
pointable = true,
5206
- -- ^ Overrides selection box when false.
5214
+ -- Overrides selection box when false
5215
+
5207
5216
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
+
5223
5233
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
+
5226
5237
mesh = "model",
5238
+
5227
5239
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
+
5233
5246
colors = {},
5234
- -- ^ Number of required colors depends on visual.
5247
+ -- Number of required colors depends on visual
5248
+
5235
5249
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
+
5239
5255
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
+
5244
5261
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
+
5248
5266
is_visible = true,
5267
+
5249
5268
makes_footstep_sound = false,
5269
+
5250
5270
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
+
5253
5274
stepheight = 0,
5275
+
5254
5276
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
+
5257
5280
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
+
5260
5284
backface_culling = true,
5261
- -- ^ Set to false to disable backface_culling for model.
5285
+ -- Set to false to disable backface_culling for model
5286
+
5262
5287
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
+
5267
5293
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
+
5271
5299
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
+
5273
5302
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'.
5278
5307
}
5279
5308
5280
5309
Entity definition
@@ -5288,21 +5317,26 @@ Used by `minetest.register_entity`.
5288
5317
mesh = "boats_boat.obj",
5289
5318
...,
5290
5319
},
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
+
5295
5325
on_activate = function(self, staticdata, dtime_s),
5326
+
5296
5327
on_step = function(self, dtime),
5328
+
5297
5329
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir),
5330
+
5298
5331
on_rightclick = function(self, clicker),
5332
+
5299
5333
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
5302
5336
5303
5337
_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
5306
5340
}
5307
5341
5308
5342
ABM (ActiveBlockModifier) definition
@@ -5312,34 +5346,40 @@ Used by `minetest.register_abm`.
5312
5346
5313
5347
{
5314
5348
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
+
5317
5352
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
+
5320
5356
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
+
5325
5362
interval = 1.0,
5326
- ^ Operation interval in seconds.
5363
+ -- Operation interval in seconds
5364
+
5327
5365
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
+
5330
5369
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
+
5335
5375
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.
5343
5383
}
5344
5384
5345
5385
LBM (LoadingBlockModifier) definition
@@ -5349,17 +5389,21 @@ Used by `minetest.register_lbm`.
5349
5389
5350
5390
{
5351
5391
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
+
5354
5395
name = "modname:replace_legacy_door",
5396
+
5355
5397
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
+
5359
5402
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
+
5363
5407
action = func(pos, node),
5364
5408
}
5365
5409
@@ -5371,32 +5415,43 @@ Used by `minetest.register_node`, `minetest.register_craftitem`, and
5371
5415
5372
5416
{
5373
5417
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
+
5380
5427
inventory_image = "default_tool_steelaxe.png",
5428
+
5381
5429
inventory_overlay = "overlay.png",
5382
- ^ An overlay which does not get colorized.
5430
+ -- An overlay which does not get colorized
5431
+
5383
5432
wield_image = "",
5433
+
5384
5434
wield_overlay = "",
5435
+
5385
5436
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
+
5394
5443
color = "0xFFFFFFFF",
5395
- ^ The color of the item. The palette overrides this.
5444
+ -- The color of the item. The palette overrides this.
5445
+
5396
5446
wield_scale = {x = 1, y = 1, z = 1},
5447
+
5397
5448
stack_max = 99,
5449
+
5398
5450
range = 4.0,
5451
+
5399
5452
liquids_pointable = false,
5453
+
5454
+ -- See "Tools" section
5400
5455
tool_capabilities = {
5401
5456
full_punch_interval = 1.0,
5402
5457
max_drop_level = 0,
@@ -5407,84 +5462,79 @@ Used by `minetest.register_node`, `minetest.register_craftitem`, and
5407
5462
},
5408
5463
damage_groups = {groupname = damage},
5409
5464
},
5465
+
5410
5466
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
+
5419
5474
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
+
5426
5480
sound = {
5427
- breaks = "default_tool_break", -- tools only
5428
- place = --[[ <SimpleSoundSpec>]] ,
5481
+ breaks = "default_tool_break", -- tools only
5482
+ place = <SimpleSoundSpec>,
5429
5483
},
5430
5484
5431
5485
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
+
5436
5490
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
+
5442
5495
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
+
5447
5500
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
+
5457
5509
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
+
5469
5520
_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.
5475
5524
}
5476
5525
5477
5526
Tile definition
5478
5527
---------------
5528
+
5479
5529
* `"image.png"`
5480
5530
* `{name="image.png", animation={Tile Animation definition}}`
5481
5531
* `{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}`
5483
5533
* backface culling enabled by default for most nodes
5484
5534
* tileable flags are info for shaders, how they should treat texture
5485
- when displacement mapping is used
5535
+ when displacement mapping is used.
5486
5536
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.
5488
5538
* align style determines whether the texture will be rotated with the node
5489
5539
or kept aligned with its surroundings. "user" means that client
5490
5540
setting will be used, similar to `glasslike_framed_optional`.
@@ -5505,22 +5555,28 @@ Tile animation definition
5505
5555
5506
5556
{
5507
5557
type = "vertical_frames",
5558
+
5508
5559
aspect_w = 16,
5509
- -- ^ specify width of a frame in pixels
5560
+ -- Width of a frame in pixels
5561
+
5510
5562
aspect_h = 16,
5511
- -- ^ specify height of a frame in pixels
5563
+ -- Height of a frame in pixels
5564
+
5512
5565
length = 3.0,
5513
- -- ^ specify full loop length
5566
+ -- Full loop length
5514
5567
}
5515
5568
5516
5569
{
5517
5570
type = "sheet_2d",
5571
+
5518
5572
frames_w = 5,
5519
- -- ^ specify width in number of frames
5573
+ -- Width in number of frames
5574
+
5520
5575
frames_h = 3,
5521
- -- ^ specify height in number of frames
5576
+ -- Height in number of frames
5577
+
5522
5578
frame_length = 0.5,
5523
- -- ^ specify length of a single frame
5579
+ -- Length of a single frame
5524
5580
}
5525
5581
5526
5582
Node definition
@@ -5531,252 +5587,284 @@ Used by `minetest.register_node`.
5531
5587
{
5532
5588
-- <all fields allowed in item definitions>,
5533
5589
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
+
5559
5621
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
+
5567
5631
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
+
5572
5640
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
+
5574
5643
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
+
5597
5680
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
+
5605
5689
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
+
5612
5699
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
+
5616
5703
mesh = "model",
5704
+
5617
5705
selection_box = {
5618
5706
type = "fixed",
5619
5707
fixed = {
5620
5708
{-2 / 16, -0.5, -2 / 16, 2 / 16, 3 / 16, 2 / 16},
5621
5709
},
5622
5710
},
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
+
5626
5715
collision_box = {
5627
5716
type = "fixed",
5628
5717
fixed = {
5629
5718
{-2 / 16, -0.5, -2 / 16, 2 / 16, 3 / 16, 2 / 16},
5630
5719
},
5631
5720
},
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
5637
5728
legacy_facedir_simple = false,
5638
- ^ Support maps made in and before January 2012.
5639
5729
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
+
5648
5739
sounds = {
5649
5740
footstep = <SimpleSoundSpec>,
5650
- dig = <SimpleSoundSpec>, -- "__group" = group-based sound (default)
5741
+ dig = <SimpleSoundSpec>, -- "__group" = group-based sound (default)
5651
5742
dug = <SimpleSoundSpec>,
5652
5743
place = <SimpleSoundSpec>,
5653
5744
place_failed = <SimpleSoundSpec>,
5654
5745
},
5746
+
5655
5747
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:
5658
5750
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 = {
5661
5755
{
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
5666
5759
},
5667
5760
},
5668
5761
},
5669
5762
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.
5725
5818
5726
5819
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
5750
5842
5751
5843
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.
5755
5846
5756
5847
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.
5761
5851
5762
5852
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.
5767
5856
5768
5857
on_metadata_inventory_move = func(pos, from_list, from_index, to_list, to_index, count, player),
5769
5858
on_metadata_inventory_put = func(pos, listname, index, stack, player),
5770
5859
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.
5780
5868
}
5781
5869
5782
5870
Crafting recipes
@@ -5791,24 +5879,26 @@ Used by `minetest.register_craft`.
5791
5879
recipe = {
5792
5880
{'default:cobble', 'default:cobble', 'default:cobble'},
5793
5881
{'', 'default:stick', ''},
5794
- {'', 'default:stick', ''}, -- Also groups; e.g. 'group:crumbly'
5882
+ {'', 'default:stick', ''}, -- Also groups; e.g. 'group:crumbly'
5795
5883
},
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).
5798
5887
}
5799
5888
5800
5889
### Shapeless
5801
5890
5802
5891
{
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).
5812
5902
}
5813
5903
5814
5904
### Tool repair
@@ -5840,34 +5930,43 @@ Ore definition
5840
5930
5841
5931
Used by `minetest.register_ore`.
5842
5932
5843
- See 'Ore types ' section above for essential information.
5933
+ See 'Ores ' section above for essential information.
5844
5934
5845
5935
{
5846
5936
ore_type = "scatter",
5937
+
5847
5938
ore = "default:stone_with_coal",
5939
+
5848
5940
ore_param2 = 3,
5849
- -- ^ Facedir rotation. Default is 0 (unchanged rotation)
5941
+ -- Facedir rotation. Default is 0 (unchanged rotation)
5942
+
5850
5943
wherein = "default:stone",
5851
- -- ^ a list of nodenames is supported too
5944
+ -- A list of nodenames is supported too
5945
+
5852
5946
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
+
5856
5951
clust_num_ores = 8,
5857
- -- ^ Number of ores in a cluster
5952
+ -- Number of ores in a cluster
5953
+
5858
5954
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
5862
5960
y_min = -31000,
5863
5961
y_max = 64,
5864
- -- ^ Lower and upper limits for ore.
5962
+
5865
5963
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
+
5868
5966
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
+
5871
5970
noise_params = {
5872
5971
offset = 0,
5873
5972
scale = 1,
@@ -5876,22 +5975,27 @@ See 'Ore types' section above for essential information.
5876
5975
octaves = 3,
5877
5976
persist = 0.7
5878
5977
},
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
5890
5994
column_height_min = 1,
5891
5995
column_height_max = 16,
5892
5996
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
5895
5999
np_puff_top = {
5896
6000
offset = 4,
5897
6001
scale = 2,
@@ -5908,11 +6012,11 @@ See 'Ore types' section above for essential information.
5908
6012
octaves = 3,
5909
6013
persist = 0.7
5910
6014
},
5911
- -- ^ See 'Ore types' section above.
5912
- -- ^ The above 2 parameters are only valid for "puff" ore.
6015
+
6016
+ -- vein
5913
6017
random_factor = 1.0,
5914
- -- ^ See 'Ore types' section above.
5915
- -- ^ Only valid for "vein" ore.
6018
+
6019
+ -- stratum
5916
6020
np_stratum_thickness = {
5917
6021
offset = 8,
5918
6022
scale = 4,
@@ -5922,8 +6026,6 @@ See 'Ore types' section above for essential information.
5922
6026
persist = 0.7
5923
6027
},
5924
6028
stratum_thickness = 8,
5925
- -- ^ See 'Ore types' section above.
5926
- -- ^ The above 2 parameters are only valid for "stratum" ore.
5927
6029
}
5928
6030
5929
6031
Biome definition
@@ -5933,86 +6035,105 @@ Used by `minetest.register_biome`.
5933
6035
5934
6036
{
5935
6037
name = "tundra",
6038
+
5936
6039
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
+
5938
6042
node_top = "default:dirt_with_snow",
5939
6043
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
+
5941
6046
node_filler = "default:permafrost",
5942
6047
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
+
5944
6050
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
+
5946
6053
node_water_top = "default:ice",
5947
6054
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
+
5949
6057
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
+
5952
6060
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
+
5955
6064
node_riverbed = "default:gravel",
5956
6065
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
+
5958
6068
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
+
5962
6073
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
+
5966
6078
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
+
5970
6083
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
+
5973
6087
y_max = 31000,
5974
6088
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
+
5977
6092
max_pos = {x = 31000, y = 128, z = 31000},
5978
6093
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
+
5983
6099
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
+
5987
6104
heat_point = 0,
5988
6105
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.
5995
6112
}
5996
6113
5997
6114
Decoration definition
5998
6115
---------------------
5999
6116
6000
- Used by `minetest.register_decoration`.
6117
+ See "Decoration types". Used by `minetest.register_decoration`.
6001
6118
6002
6119
{
6003
- deco_type = "simple", -- See "Decoration types"
6120
+ deco_type = "simple",
6121
+
6004
6122
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
+
6006
6125
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
+
6011
6131
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
+
6016
6137
noise_params = {
6017
6138
offset = 0,
6018
6139
scale = 0.45,
@@ -6023,82 +6144,93 @@ Used by `minetest.register_decoration`.
6023
6144
lacunarity = 2.0,
6024
6145
flags = "absvalue"
6025
6146
},
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
+
6032
6154
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
+
6041
6165
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
+
6046
6171
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
+
6050
6176
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.
6067
6193
6068
6194
----- Simple-type parameters
6195
+
6069
6196
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
+
6073
6201
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
+
6077
6206
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
+
6080
6210
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
+
6084
6215
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
+
6087
6219
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.
6094
6226
6095
6227
----- Schematic-type parameters
6228
+
6096
6229
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
+
6102
6234
schematic = {
6103
6235
size = {x = 4, y = 6, z = 4},
6104
6236
data = {
@@ -6113,20 +6245,26 @@ Used by `minetest.register_decoration`.
6113
6245
...
6114
6246
},
6115
6247
},
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
+
6117
6252
replacements = {["oldname"] = "convert_to", ...},
6253
+
6118
6254
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
+
6120
6257
rotation = "90",
6121
- -- ^ Rotation can be "0", "90", "180", "270", or "random".
6258
+ -- Rotation can be "0", "90", "180", "270", or "random"
6259
+
6122
6260
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.
6130
6268
}
6131
6269
6132
6270
Chat command definition
@@ -6135,12 +6273,14 @@ Chat command definition
6135
6273
Used by `minetest.register_chatcommand`.
6136
6274
6137
6275
{
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.
6144
6284
}
6145
6285
6146
6286
Note that in params, use of symbols is as follows:
@@ -6162,52 +6302,61 @@ Used by `minetest.create_detached_inventory`.
6162
6302
6163
6303
{
6164
6304
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.
6167
6307
6168
6308
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.
6172
6312
6173
6313
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.
6177
6317
6178
6318
on_move = func(inv, from_list, from_index, to_list, to_index, count, player),
6179
6319
on_put = func(inv, listname, index, stack, player),
6180
6320
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.
6184
6324
}
6185
6325
6186
6326
HUD Definition
6187
6327
--------------
6188
6328
6329
+ See "HUD" section.
6330
+
6189
6331
Used by `Player:hud_add`. Returned by `Player:hud_get`.
6190
6332
6191
6333
{
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
+
6195
6337
position = {x=0.5, y=0.5},
6196
- -- ^ Left corner position of element
6338
+ -- Left corner position of element
6339
+
6197
6340
name = "<name>",
6341
+
6198
6342
scale = {x = 2, y = 2},
6343
+
6199
6344
text = "<text>",
6345
+
6200
6346
number = 2,
6347
+
6201
6348
item = 3,
6202
- -- ^ Selected item in inventory. 0 for no item selected.
6349
+ -- Selected item in inventory. 0 for no item selected.
6350
+
6203
6351
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
+
6205
6354
alignment = {x=0, y=0},
6206
- -- ^ See "HUD Element Types"
6355
+
6207
6356
offset = {x=0, y=0},
6208
- -- ^ See "HUD Element Types"
6357
+
6209
6358
size = { x=100, y=100 },
6210
- -- ^ Size of element in pixels
6359
+ -- Size of element in pixels
6211
6360
}
6212
6361
6213
6362
Particle definition
@@ -6219,26 +6368,34 @@ Used by `minetest.add_particle`.
6219
6368
pos = {x=0, y=0, z=0},
6220
6369
velocity = {x=0, y=0, z=0},
6221
6370
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
+
6223
6373
expirationtime = 1,
6224
- -- ^ Disappears after expirationtime seconds
6374
+ -- Disappears after expirationtime seconds
6375
+
6225
6376
size = 1,
6377
+
6226
6378
collisiondetection = false,
6227
- -- ^ collisiondetection: if true collides with physical objects
6379
+ -- If true collides with physical objects
6380
+
6228
6381
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
+
6231
6385
vertical = false,
6232
- -- ^ vertical: if true faces player using y axis only
6386
+ -- If true faces player using y axis only
6387
+
6233
6388
texture = "image.png",
6234
- -- ^ Uses texture (string)
6389
+
6235
6390
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
+
6237
6393
animation = {Tile Animation definition},
6238
- -- ^ Optional, specifies how to animate the particle texture
6394
+ -- Optional, specifies how to animate the particle texture
6395
+
6239
6396
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.
6242
6399
}
6243
6400
6244
6401
@@ -6249,9 +6406,11 @@ Used by `minetest.add_particlespawner`.
6249
6406
6250
6407
{
6251
6408
amount = 1,
6409
+
6252
6410
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
+
6255
6414
minpos = {x=0, y=0, z=0},
6256
6415
maxpos = {x=0, y=0, z=0},
6257
6416
minvel = {x=0, y=0, z=0},
@@ -6262,30 +6421,34 @@ Used by `minetest.add_particlespawner`.
6262
6421
maxexptime = 1,
6263
6422
minsize = 1,
6264
6423
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
+
6269
6427
collisiondetection = false,
6270
- -- ^ collisiondetection: if true uses collision detection
6428
+ -- If true collides with physical objects
6429
+
6271
6430
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
+
6274
6434
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
+
6277
6438
vertical = false,
6278
- -- ^ vertical: if true faces player using y axis only
6439
+ -- If true faces player using y axis only
6440
+
6279
6441
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
+
6284
6446
animation = {Tile Animation definition},
6285
- -- ^ Optional, specifies how to animate the particle texture
6447
+ -- Optional, specifies how to animate the particle texture
6448
+
6286
6449
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.
6289
6452
}
6290
6453
6291
6454
`HTTPRequest` definition
@@ -6295,23 +6458,28 @@ Used by `HTTPApiTable.fetch` and `HTTPApiTable.fetch_async`.
6295
6458
6296
6459
{
6297
6460
url = "http://example.org",
6461
+
6298
6462
timeout = 10,
6299
- -- ^ Timeout for connection in seconds. Default is 3 seconds.
6463
+ -- Timeout for connection in seconds. Default is 3 seconds.
6464
+
6300
6465
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
+
6305
6471
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
+
6308
6475
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
+
6312
6480
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.
6315
6483
}
6316
6484
6317
6485
`HTTPRequestResult` definition
@@ -6322,14 +6490,18 @@ Passed to `HTTPApiTable.fetch` callback. Returned by
6322
6490
6323
6491
{
6324
6492
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
+
6327
6496
succeeded = true,
6328
- -- ^ If true, the request was successful
6497
+ -- If true, the request was successful
6498
+
6329
6499
timeout = false,
6330
- -- ^ If true, the request timed out
6500
+ -- If true, the request timed out
6501
+
6331
6502
code = 200,
6332
- -- ^ HTTP status code
6503
+ -- HTTP status code
6504
+
6333
6505
data = "response"
6334
6506
}
6335
6507
@@ -6340,30 +6512,37 @@ Used by `minetest.register_authentication_handler`.
6340
6512
6341
6513
{
6342
6514
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
+
6347
6520
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
+
6351
6525
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
+
6354
6529
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
+
6357
6533
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
+
6361
6538
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
+
6364
6542
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
+
6366
6545
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
6369
6548
}
0 commit comments