@@ -2023,10 +2023,10 @@ Item metadata only contains a key-value store.
2023
2023
2024
2024
Some of the values in the key-value store are handled specially:
2025
2025
2026
- * `description`: Set the item stack's description. Defaults to
2027
- `idef.description`.
2028
- * `short_description`: Set the item stack's short description. Defaults
2029
- to `idef.short_description`.
2026
+ * `description`: Set the item stack's description.
2027
+ See also: `get_description` in [`ItemStack`]
2028
+ * `short_description`: Set the item stack's short description.
2029
+ See also: `get_short_description` in [`ItemStack`]
2030
2030
* `color`: A `ColorString`, which sets the stack's color.
2031
2031
* `palette_index`: If the item has a palette, this is used to get the
2032
2032
current color from the palette.
@@ -5983,8 +5983,18 @@ an itemstring, a table or `nil`.
5983
5983
stack).
5984
5984
* `set_metadata(metadata)`: (DEPRECATED) Returns true.
5985
5985
* `get_description()`: returns the description shown in inventory list tooltips.
5986
+ * The engine uses the same as this function for item descriptions.
5987
+ * Fields for finding the description, in order:
5988
+ * `description` in item metadata (See [Item Metadata].)
5989
+ * `description` in item definition
5990
+ * item name
5986
5991
* `get_short_description()`: returns the short description.
5987
5992
* Unlike the description, this does not include new lines.
5993
+ * The engine uses the same as this function for short item descriptions.
5994
+ * Fields for finding the short description, in order:
5995
+ * `short_description` in item metadata (See [Item Metadata].)
5996
+ * `short_description` in item definition
5997
+ * first line of the description (See `get_description()`.)
5988
5998
* `clear()`: removes all items from the stack, making it empty.
5989
5999
* `replace(item)`: replace the contents of this stack.
5990
6000
* `item` can also be an itemstring or table.
@@ -7085,11 +7095,12 @@ Used by `minetest.register_node`, `minetest.register_craftitem`, and
7085
7095
{
7086
7096
description = "Steel Axe",
7087
7097
-- Can contain new lines. "\n" has to be used as new line character.
7088
- -- Defaults to the item's name.
7098
+ -- See also: `get_description` in [`ItemStack`]
7089
7099
7090
7100
short_description = "Steel Axe",
7091
7101
-- Must not contain new lines.
7092
7102
-- Defaults to the first line of description.
7103
+ -- See also: `get_short_description` in [`ItemStack`]
7093
7104
7094
7105
groups = {},
7095
7106
-- key = name, value = rating; rating = 1..3.
0 commit comments