Now I tried and tested a million variants of the following piece of code:
Code: Select all
script.on_event(defines.events.on_player_cursor_stack_changed, function(event)
local player = game.get_player(event.player_index)
player.print("---")
if player.cursor_stack.valid then
player.print("Stack is valid")
else
player.print("Stack is NOT valid")
end
if player.cursor_stack.valid_for_read then
player.print("Stack is valid for read")
else
player.print("Stack is NOT valid for read")
end
if player.cursor_stack.is_blueprint then
player.print("Stack is a blueprint")
else
player.print("Stack is NOT a blueprint")
end
if player.is_cursor_blueprint then
player.print("Cursor is a blueprint")
else
player.print("Cursor is NOT a blueprint")
end
end)
Is this a known issue? And how can I read a blueprint item from the library?