mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
builtin: Return 'obj' from 'core.item_drop' (#15880)
This also includes a minor bugfix where 'itemstack' was cleared even if the object placement failed.
This commit is contained in:
parent
afb15978d9
commit
23d0fb2d3f
3 changed files with 31 additions and 6 deletions
|
@ -6937,8 +6937,13 @@ Defaults for the `on_place` and `on_drop` item definition functions
|
|||
* Parameters are the same as in `on_pickup`.
|
||||
* Returns the leftover itemstack.
|
||||
* `core.item_drop(itemstack, dropper, pos)`
|
||||
* Drop the item
|
||||
* returns the leftover itemstack
|
||||
* Converts `itemstack` to an in-world Lua entity.
|
||||
* `itemstack` (`ItemStack`) is modified (cleared) on success.
|
||||
* In versions < 5.12.0, `itemstack` was cleared in all cases.
|
||||
* `dropper` (`ObjectRef`) is optional.
|
||||
* Returned values on success:
|
||||
1. leftover itemstack
|
||||
2. `ObjectRef` of the spawned object (provided since 5.12.0)
|
||||
* `core.item_eat(hp_change[, replace_with_item])`
|
||||
* Returns `function(itemstack, user, pointed_thing)` as a
|
||||
function wrapper for `core.do_item_eat`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue