From 210d4204ce79623eca4902954da135a7965fc8fe Mon Sep 17 00:00:00 2001 From: Vanic Date: Wed, 26 Nov 2025 18:56:03 +0300 Subject: [PATCH] Add annotation `minetest.item_pickup` & `minetest.item_secondary_use`. close #4 --- core_namespace.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core_namespace.lua b/core_namespace.lua index 85bc2b4..0389489 100644 --- a/core_namespace.lua +++ b/core_namespace.lua @@ -1757,6 +1757,22 @@ function minetest.item_place_object(itemstack, placer, pointed_thing) end --- @param param2 number --- @return ItemStack, vector|nil function minetest.item_place(itemstack, placer, pointed_thing, param2) end + +--- * Runs callbacks registered by `core.register_on_item_pickup` and adds the item to the picker's `"main"` inventory list. +--- * Parameters and return value are the same as `on_pickup`. +--- * **Note**: is not called when wielded item overrides `on_pickup` +--- @param itemstack ItemStack +--- @param picker Player|ObjectRef|nil +--- @param pointed_thing pointed_thing +--- @param time_from_last_punch number +--- @param ... any +function minetest.item_pickup(itemstack, picker, pointed_thing, time_from_last_punch, ...) end +--- * Global secondary use callback. Does nothing. +--- * Parameters and return value are the same as on_secondary_use. +--- * **Note**: is not called when wielded item overrides on_secondary_use +--- @param itemstack ItemStack +--- @param user Player|ObjectRef|nil +function minetest.item_secondary_use(itemstack, user) end --- * Drop the item --- * returns the leftover itemstack ---