mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
update doc/*/scripting/events.md
This commit is contained in:
parent
1a6880a572
commit
b3e5f2a1c0
2 changed files with 18 additions and 0 deletions
|
|
@ -53,6 +53,15 @@ function on_block_tick(x, y, z, tps: number)
|
|||
Called tps (20 / tick-interval) times per second for a block.
|
||||
Use 1/tps instead of `time.delta()`.
|
||||
|
||||
```lua
|
||||
function on_block_present(x, y, z)
|
||||
```
|
||||
|
||||
Called for a specific block when it appears in the world (generated/loaded/placed).
|
||||
The call occurs within a time period that may depend on the event queue load.
|
||||
Under light load, it occurs during the first tick interval of the block.
|
||||
on_block_tick is not called until the event is called.
|
||||
|
||||
```lua
|
||||
function on_player_tick(playerid: int, tps: int)
|
||||
```
|
||||
|
|
|
|||
|
|
@ -53,6 +53,15 @@ function on_block_tick(x, y, z, tps: number)
|
|||
Вызывается tps (20 / tick-interval) раз в секунду для конкретного блока.
|
||||
Используйте 1/tps вместо `time.delta()`.
|
||||
|
||||
```lua
|
||||
function on_block_present(x, y, z)
|
||||
```
|
||||
|
||||
Вызывается для конкретного блока при появлении (генерации/загрузке/размещении).
|
||||
Вызов происходит в течение времени, которое может зависеть от нагрузки очереди событий.
|
||||
При малой нагрузке происходит в течение первого такта блока (tick-interval).
|
||||
До вызова события on_block_tick не вызывается.
|
||||
|
||||
```lua
|
||||
function on_player_tick(playerid: int, tps: int)
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue