1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2025-06-28 06:30:18 +02:00

add pick_up and on_pick_up features.

This commit is contained in:
tenplus1
2025-02-04 10:21:10 +00:00
parent 4b825b3e86
commit c62b013825
3 changed files with 56 additions and 1 deletions

19
api.txt
View File

@ -310,6 +310,25 @@ eating.
properties. (DEPRECATED, use on_replace to make changes).
Pickup Items
------------
'pick_up' table of itemstrings the mob will pick up.
'on_pick_up' function that will be called on item pickup - arguments are
(self, itemstring) and can return nil or a a modified itemstack e.g.
on_pick_up = function(self, itemstring)
local istack = ItemStack(entity.itemstring)
print("-- took", istack:get_name())
istack:take_item(1)
return istack
end,
Custom Definition Functions
---------------------------