Code: Select all
local bp_string = "your blueprint string here"
local surface = game.player.surface
local bp_entity = surface.create_entity{name = 'item-on-ground', position= game.player.position, stack = 'blueprint'}
bp_entity.stack.import_stack(bp_string)
local bp_entities = bp_entity.stack.get_blueprint_entities(bp_string)
local bpInfo = {surface = surface, force = "north", position= game.player.position, force_build = 'true', direction = 0, skip_fog_of_war = 'true', by_player = player, raise_built = 'false'}
local bpResult = bp_entity.stack.build_blueprint(bpInfo)
bp_entity.destroy()
It is placing blueprint ghosts but the second part of the code is not building those entities. I don't know why.