Mods may want to to handle item interaction even if the item
is not marked usable (= server-side callback exists).
print("pointed_thing :" .. dump(pointed_thing))
print("item = " .. itemstack:get_name())
+ if not itemstack:is_empty() then
+ return false
+ end
+
local pos = vector.add(core.localplayer:get_pos(), core.camera:get_offset())
local pos2 = vector.add(pos, vector.multiply(core.camera:get_look_dir(), 100))
} else if (input->getLeftState()) {
// When button is held down in air, show continuous animation
runData.left_punch = true;
+ // Run callback even though item is not usable
+ if (input->getLeftClicked() && client->modsLoaded())
+ client->getScript()->on_item_use(selected_item, pointed);
} else if (input->getRightClicked()) {
handlePointingAtNothing(selected_item);
}