Example code works on normal entities but not ghost entities, data is the serialized entity properties.
Code: Select all
local inventory = entity.get_inventory(defines.inventory.chest)
for index, filter in pairs(data.inventory_filters) do
inventory.set_filter(index, filter)
end