update doc/*/block-properties.md

This commit is contained in:
MihailRis 2024-12-29 09:22:35 +03:00
parent f744c87c8e
commit 7044c12da5
2 changed files with 56 additions and 0 deletions

View File

@ -214,6 +214,34 @@ User properties must be declared in `pack:config/user-props.toml` file:
Example: [user properties of pack **base**](../../res/content/base/config/user-props.toml).
## Properties introduced by the `base` pack
### *base:durability*
The time it takes to break a block without tools or effects, measured in seconds.
### Loot - *base:loot*
A list of tables with properties:
```json
{
"item": "pack:item",
"min": 1,
"max": 3,
"chance": 0.5
}
```
- `count` defaults to 1. It does not need to be specified if `min` and `max` are provided.
- `min`, `max` - the minimum and maximum quantity of the item.
- `chance` - the probability of the item dropping. Defaults to 1.0.
It should be noted that the `item` refers specifically to the item. That is, to specify the item of a block, you need to add `.item` after the block name.
Example: `base:dirt.item`.
To generate loot, the function `block_loot(block_id: int)` in the `base:util` module should be used.
## Methods
Methods are used to manage the overwriting of properties when extending a block with other packs.

View File

@ -225,6 +225,34 @@
Пример: [пользовательские свойства пака **base**](../../res/content/base/config/user-props.toml).
## Свойства, вводимые паком `base`
### Прочность - *base:durability*
Время разрушения блока без инструментов и эффектов в секундах.
### Лут - *base:loot*
Список таблиц со свойствами:
```json
{
"item": "пак:предмет",
"min": 1,
"max": 3,
"chance": 0.5
}
```
- count равен 1 по-умолчанию. Не нужно указывать если указаны `min` и `max`.
- min, max - минимальное и максимальное количество предмета.
- chance - вероятность выпадения предмета. По-умолчанию: 1.0.
Следует учитывать, что в item указывается именно предмет. Т.е. чтобы указать предмет блока, нужно добавить `.item` после имени блока.
Пример: `base:dirt.item`.
Для генерации лута следует использовать функцию `block_loot(block_id: int)` в модуле `base:util`.
## Методы
Методы используются для управлением перезаписью свойств при расширении блока другими паками.