Code: Select all
local count = inventory.remove{name=item_name, count=game.item_prototypes[item_name].stack_size}
if count > 0 then
player.cursor_stack.set_stack{name=item_name, count=count}
end
If not possible, how do I detect an item that's not safe to move?