add player.set_selected_slot, inventory.find_by_item

This commit is contained in:
MihailRis
2024-12-23 12:24:29 +03:00
parent 1149d5869c
commit 22d207ba28
6 changed files with 115 additions and 55 deletions
+15
View File
@@ -32,6 +32,21 @@ inventory.size(invid: int) -> int
-- Returns remaining count if could not to add fully.
inventory.add(invid: int, itemid: int, count: int) -> int
-- Returns the index of the first matching slot in the given range.
-- If no matching slot was found, returns nil
inventory.find_by_item(
-- inventory id
invid: int,
-- item id
itemid: int,
-- [optional] index of the slot range start (from 0)
range_begin: int,
-- [optional] index of the slot range end (from 0)
range_end: int,
-- [optional] minimum item count in the slot
min_count: int = 1
) -> int
-- Returns block inventory ID or 0.
inventory.get_block(x: int, y: int, z: int) -> int
+6
View File
@@ -84,6 +84,12 @@ player.get_name(playerid: int) -> str
Player name setter and getter
```lua
player.set_selected_slot(playerid: int, slotid: int)
```
Sets the selected slot index
```lua
player.get_selected_block(playerid: int) -> x,y,z
```