summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDS <vorunbekannt75@web.de>2020-10-09 20:11:21 +0200
committerGitHub <noreply@github.com>2020-10-09 19:11:21 +0100
commitf3ae45b2b245dd0aeb4a7d9b76afaf078871104c (patch)
treef9b0e27043bbe8f2b16e6f4917f6b9a92f273345 /doc
parentb2f3f663858e6d2a2174066e425bb6f2edea910b (diff)
downloadminetest-f3ae45b2b245dd0aeb4a7d9b76afaf078871104c.tar.gz
minetest-f3ae45b2b245dd0aeb4a7d9b76afaf078871104c.tar.bz2
minetest-f3ae45b2b245dd0aeb4a7d9b76afaf078871104c.zip
Add a short_description to be used by mods (#8980)
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 60fea3817..c8b294149 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -2054,6 +2054,8 @@ Some of the values in the key-value store are handled specially:
* `description`: Set the item stack's description. Defaults to
`idef.description`.
+* `short_description`: Set the item stack's short description. Defaults
+ to `idef.short_description`.
* `color`: A `ColorString`, which sets the stack's color.
* `palette_index`: If the item has a palette, this is used to get the
current color from the palette.
@@ -5994,6 +5996,8 @@ an itemstring, a table or `nil`.
stack).
* `set_metadata(metadata)`: (DEPRECATED) Returns true.
* `get_description()`: returns the description shown in inventory list tooltips.
+* `get_short_description()`: returns the short description.
+ * Unlike the description, this does not include new lines.
* `clear()`: removes all items from the stack, making it empty.
* `replace(item)`: replace the contents of this stack.
* `item` can also be an itemstring or table.
@@ -7096,6 +7100,12 @@ Used by `minetest.register_node`, `minetest.register_craftitem`, and
{
description = "Steel Axe",
+ -- Can contain new lines. "\n" has to be used as new line character.
+ -- Defaults to the item's name.
+
+ short_description = "Steel Axe",
+ -- Must not contain new lines.
+ -- Defaults to the first line of description.
groups = {},
-- key = name, value = rating; rating = 1..3.