docs: describe hotbar keys by topic and hotbar size from server side

This commit is contained in:
ostermine 2026-10-16 14:06:08 +03:00
parent aa670f3c9d
commit 40e2814f9e
6 changed files with 10 additions and 10 deletions

View file

@ -97,9 +97,6 @@ Don't be intimidated by the following text, as a minimal pack only requires `pac
- Configuration:
- `config/` - Configuration files
- `defaults.toml` - Overrides for standard content bindings, such as the player entity, default generator, etc.
- `hotbar-size` - number of hotbar slots, 10 by default (see `player.set_hotbar_size`)
- `hotbar-layout` - layout replacing the built-in hotbar, for example `"pack:hotbar"`. The root element must be `inventory`, it is bound to the player inventory. Without `position-func` the layout is placed at the bottom center of the screen
- `inventory-layout` - player inventory layout, `"core:inventory"` by default. The root element must be `inventory`
- `bindings.toml` - Keyboard/Mouse bindings
- `user-props.toml` - User properties for content definitions
- `devtools/` - Auxiliary files for internal debugging tools

View file

@ -149,7 +149,7 @@ player.get_hotbar_size(playerid: int) -> int
player.set_hotbar_size(playerid: int, size: int)
```
Hotbar size getter and setter: the number of first inventory slots selected with the mouse wheel and number keys. Default value is `hotbar-size` from `config/defaults.toml` (10). The value is not saved with the world.
Hotbar size getter and setter: the number of first player inventory slots that can be selected. `player.set_selected_slot` wraps the index by it, and the selected slot is moved into the range when the size decreases. Default value is `hotbar-size` from `config/defaults.toml` (10); the value is not saved with the world. On the client these slots are shown in the hotbar and selected with the mouse wheel and number keys.
```lua
player.get_selected_block(playerid: int) -> x,y,z

View file

@ -218,6 +218,8 @@ Element is a container. Does not have specific attributes.
> [!WARNING]
> Slots not linked to an inventory will not be displayed. "Linked to an inventory" refers to the association between an inventory UI element and an inventory via an ID. This link can be explicitly established using `inventory_ui.inventory = inventory_id`. [(see ui.md)](scripting/ui.md#inventory)
A pack can replace the player inventory screen and the hotbar with its own layouts using `inventory-layout` (`"core:inventory"` by default) and `hotbar-layout` in `config/defaults.toml`. The root element of such a layout must be `inventory`, it is bound to the player inventory. The hotbar layout is placed at the bottom center of the screen unless it has `position-func`.
## *slot*
Element must be in direct sub-element of *inventory*.