@@ -4079,8 +4079,7 @@ Call these functions only at load time!
4079
4079
allow for multiple protection mods.
4080
4080
* `minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, user, pointed_thing))`
4081
4081
* Called when an item is eaten, by `minetest.item_eat`
4082
- * Return `true` or `itemstack` to cancel the default item eat response
4083
- (i.e.: hp increase).
4082
+ * Return `itemstack` to cancel the default item eat response (i.e.: hp increase).
4084
4083
* `minetest.register_on_priv_grant(function(name, granter, priv))`
4085
4084
* Called when `granter` grants the priv `priv` to `name`.
4086
4085
* Note that the callback will be called twice if it's done by a player,
@@ -5400,7 +5399,11 @@ This is basically a reference to a C++ `ServerActiveObject`
5400
5399
5401
5400
* `get_pos()`: returns `{x=num, y=num, z=num}`
5402
5401
* `set_pos(pos)`: `pos`=`{x=num, y=num, z=num}`
5403
- * `move_to(pos, continuous=false)`: interpolated move
5402
+ * `move_to(pos, continuous=false)`
5403
+ * Does an interpolated move for Lua entities for visually smooth transitions.
5404
+ * If `continuous` is true, the Lua entity will not be moved to the current
5405
+ position before starting the interpolated move.
5406
+ * For players this does the same as `set_pos`,`continuous` is ignored.
5404
5407
* `punch(puncher, time_from_last_punch, tool_capabilities, direction)`
5405
5408
* `puncher` = another `ObjectRef`,
5406
5409
* `time_from_last_punch` = time since last punch action of the puncher
@@ -5409,7 +5412,7 @@ This is basically a reference to a C++ `ServerActiveObject`
5409
5412
* `get_hp()`: returns number of hitpoints (2 * number of hearts)
5410
5413
* `set_hp(hp, reason)`: set number of hitpoints (2 * number of hearts).
5411
5414
* See reason in register_on_player_hpchange
5412
- * `get_inventory()`: returns an `InvRef`
5415
+ * `get_inventory()`: returns an `InvRef` for players, otherwise returns `nil`
5413
5416
* `get_wield_list()`: returns the name of the inventory list the wielded item
5414
5417
is in.
5415
5418
* `get_wield_index()`: returns the index of the wielded item
@@ -6058,6 +6061,10 @@ LBM (LoadingBlockModifier) definition
6058
6061
6059
6062
Used by `minetest.register_lbm`.
6060
6063
6064
+ A loading block modifier (LBM) is used to define a function that is called for
6065
+ specific nodes (defined by `nodenames`) when a mapblock which contains such nodes
6066
+ gets loaded.
6067
+
6061
6068
{
6062
6069
label = "Upgrade legacy doors",
6063
6070
-- Descriptive label for profiling purposes (optional).
@@ -6072,8 +6079,8 @@ Used by `minetest.register_lbm`.
6072
6079
6073
6080
run_at_every_load = false,
6074
6081
-- Whether to run the LBM's action every time a block gets loaded,
6075
- -- and not just for blocks that were saved last time before LBMs were
6076
- -- introduced to the world .
6082
+ -- and not only the first time the block gets loaded after the LBM
6083
+ -- was introduced .
6077
6084
6078
6085
action = function(pos, node),
6079
6086
}
@@ -6516,10 +6523,10 @@ Used by `minetest.register_node`.
6516
6523
-- default: nil
6517
6524
6518
6525
can_dig = function(pos, [player]),
6519
-
6520
- on_punch = function(pos, node, puncher, pointed_thing),
6521
6526
-- Returns true if node can be dug, or false if not.
6522
6527
-- default: nil
6528
+
6529
+ on_punch = function(pos, node, puncher, pointed_thing),
6523
6530
-- default: minetest.node_punch
6524
6531
-- By default calls minetest.register_on_punchnode callbacks.
6525
6532
0 commit comments