From b3e5f2a1c01de2f7bda4f864c1d19ce13914d4d5 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 18 Nov 2025 20:58:12 +0300 Subject: [PATCH] update doc/*/scripting/events.md --- doc/en/scripting/events.md | 9 +++++++++ doc/ru/scripting/events.md | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/doc/en/scripting/events.md b/doc/en/scripting/events.md index fce3abfb..ec66b9f9 100644 --- a/doc/en/scripting/events.md +++ b/doc/en/scripting/events.md @@ -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) ``` diff --git a/doc/ru/scripting/events.md b/doc/ru/scripting/events.md index 73a6bc0c..311e5a32 100644 --- a/doc/ru/scripting/events.md +++ b/doc/ru/scripting/events.md @@ -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) ```