[0.16.16] don't get event on_built_entity on building entity
Posted: Sat Jan 13, 2018 8:40 pm
Hi all.
I've made item for control:
Name of this item is not the same as place_result.
control.lua has this code:
By placing of any item with same name entity I get text, but when item has one name and entity has another name, then I get nothing.
Example mod: How to reproduce:
Place all objects from inventory and by BPC you get no notification.
I've made item for control:
Code: Select all
{
type = "item",
name = "private-chest-requester",
icons = {
{icon = "__base__/graphics/icons/logistic-chest-requester.png"},
{icon = "__PrivateBufferChest__/PBC.png"}
},
icon_size = 32,
flags = {"goes-to-quickbar"},
subgroup = "logistic-network",
order = "b[storage]-e[logistic-chest-requester]-z",
place_result = "logistic-chest-requester",
stack_size = 50
},
control.lua has this code:
Code: Select all
script.on_event(defines.events.on_built_entity, function(event)
local entity = event.created_entity
local player = game.players[event.player_index]
player.print('entity is ' .. entity.name)
end)
Example mod: How to reproduce:
Place all objects from inventory and by BPC you get no notification.