inventory.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---@diagnostic disable: missing-return
  2. ---@meta
  3. ---Inventory
  4. ------------
  5. ---@class mt.InvLocation
  6. ---@field type "player"|"node"|"detached"|"undefined"
  7. ---@field name string|nil
  8. ---@field pos mt.Vector|nil
  9. ---@param location mt.InvLocation
  10. ---@return mt.InvRef
  11. function minetest.get_inventory(location) end
  12. -- Creates a detached inventory. If it already exists, it is cleared.
  13. --
  14. -- `player_name`: Make detached inventory available to one player
  15. -- exclusively, by default they will be sent to every player (even if not used).
  16. -- Note that this parameter is mostly just a workaround and will be removed
  17. -- in future releases.
  18. ---@param name string
  19. ---@param callbacks mt.DetachedInvDef
  20. ---@param player_name string|nil
  21. ---@return mt.InvRef
  22. function minetest.create_detached_inventory(name, callbacks, player_name) end
  23. ---@param name string
  24. ---@return boolean success
  25. function minetest.remove_detached_inventory(name) end
  26. ---@param hp_change integer
  27. ---@param replace_with_item mt.Item
  28. ---@param itemstack mt.Item
  29. ---@param user mt.ObjectRef
  30. ---@param pointed_thing mt.PointedThing
  31. ---@return mt.ItemStack leftover
  32. function minetest.do_item_eat(
  33. hp_change,
  34. replace_with_item,
  35. itemstack,
  36. user,
  37. pointed_thing
  38. )
  39. end