add on_block_interact world event

This commit is contained in:
MihailRis
2024-11-05 13:55:07 +03:00
parent f686749ae8
commit f6f82644d4
6 changed files with 63 additions and 37 deletions
+6
View File
@@ -102,6 +102,12 @@ function on_block_broken(blockid, x, y, z, playerid)
Called on block broken by player
```lua
function on_block_interact(blockid, x, y, z, playerid) -> bool
```
Called on block RMB click interaction. Prevents block placing if **true** returned.
## Layout events
Script *layouts/layout_name.xml.lua* events.
+6
View File
@@ -102,6 +102,12 @@ function on_block_broken(blockid, x, y, z, playerid)
Вызывается после разрушения блока игроком
```lua
function on_block_interact(blockid, x, y, z, playerid) -> bool
```
Вызывается при нажатии на блок ПКМ. Предотвращает установку блоков, если возвращает `true`
## События макета
События прописываются в файле `layouts/имя_макета.xml.lua`.