1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-17 18:35:20 +02:00

Allow damage for attached objects, add attach/detach callbacks (#6786)

* Allow right-clicking on attached LuaEntities
This commit is contained in:
SmallJoker
2018-04-30 18:43:49 +02:00
committed by GitHub
parent 0b5b32b026
commit ba91624d8c
9 changed files with 136 additions and 78 deletions

View File

@@ -4868,6 +4868,13 @@ Registered entities
* Called when the object dies.
* `killer`: an `ObjectRef` (can be `nil`)
* `on_rightclick(self, clicker)`
* `on_attach_child(self, child)`
* `child`: an `ObjectRef` (can be `nil`) of the child that attaches
* `on_detach_child(self, child)`
* `child`: an `ObjectRef` (can be `nil`) of the child that detaches
* `on_detach(self, parent)`
* `parent`: an `ObjectRef` (can be `nil`) from where it got detached
* This happens before the parent object is removed from the world
* `get_staticdata(self)`
* Should return a string that will be passed to `on_activate` when
the object is instantiated the next time.