document tick-interval

This commit is contained in:
MihailRis
2025-12-08 19:21:50 +03:00
committed by ShiftyX1
parent f1d9f1bf60
commit db09672e50
4 changed files with 23 additions and 11 deletions
+10 -4
View File
@@ -216,10 +216,6 @@ Item will be chosen on MMB click on the block.
Example: block `door:door_open` is hidden, so you need to specify `picking-item: "door:door.item"` to bind it to not hidden `door:door` block item.
### *script-name*
Used to specify block script name (to reuse one script to multiple blocks). Name must not contain `packid:scripts/` and extension. Just name.
### *ui-layout*
Block UI XML layout name. Default: string block id.
@@ -316,6 +312,16 @@ Example: `base:dirt.item`.
To generate loot, the function `block_loot(block_id: int)` in the `base:util` module should be used.
## Other properties
### *script-name*
Used to specify block script name (to reuse one script to multiple blocks). Name must not contain `packid:scripts/` and extension. Just name.
### Tick Interval - *tick-interval*
The interval in ticks (1/20th of a second). A value of 20 results in an on_block_tick call interval of one second.
## Methods
Methods are used to manage the overwriting of properties when extending a block with other packs.
+1 -1
View File
@@ -48,7 +48,7 @@ Called on random block update (grass growth)
function on_blocks_tick(tps: int)
```
Called tps (20) times per second. Use 1/tps instead of `time.delta()`.
Called tps (20 / tick-interval) times per second. Use 1/tps instead of `time.delta()`.
```lua
function on_block_tick(x, y, z, tps: number)