Getting entities in a blueprint

Place to get help with not working mods / modding interface.
Post Reply
Tim3303
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Sep 28, 2018 4:50 pm
Contact:

Getting entities in a blueprint

Post 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!

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Getting entities in a blueprint

Post by DaveMcW »

Code: Select all

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

Post Reply

Return to “Modding help”