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:
19
api.txt
19
api.txt
@ -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
|
||||
---------------------------
|
||||
|
||||
|
Reference in New Issue
Block a user