add item.caption(...) function & move item library docs to libitem.md

This commit is contained in:
MihailRis
2024-10-15 04:48:01 +03:00
parent 57e397e692
commit 4dfa235f12
6 changed files with 54 additions and 65 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ block.index(name: str) -> int
-- Returns the id of the block material.
block.material(blockid: int) -> str
-- Returns the block name displayed in the UI.
-- Returns the block display name.
block.caption(blockid: int) -> str
-- Returns integer ID by block position
+21
View File
@@ -0,0 +1,21 @@
# *item* library
```lua
-- Returns item string ID (name) by index
item.name(itemid: int) -> str
-- Returns item integer ID (index) by name
item.index(name: str) -> int
-- Returns the item display name.
block.caption(blockid: int) -> str
-- Returns max stack size for the item
item.stack_size(itemid: int) -> int
-- Returns count of available item IDs.
item.defs_count() -> int
-- Returns item icon name to use in 'src' property of an image element
item.icon(itemid: int) -> str
```