Page 1 of 1

Getting entities in a blueprint

Posted: Sat Dec 01, 2018 8:04 pm
by Tim3303
Hey,

I want to iterate over entities inside a blueprint that just got placed (specifically, the entities that can have a recipe).
How can I access the ghost's contents via the event passed by on_built_entity?

Thanks a lot in advance!

Re: Getting entities in a blueprint

Posted: Sat Dec 01, 2018 10:41 pm
by DaveMcW

Code: Select all

local recipe = nil
if entity.ghost_type == "assembling-machine" then
  recipe = entity.get_recipe()
end