luaEntity.get_mining_results()

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

luaEntity.get_mining_results()

Post by Nexela »

luaEntity.get_mining_results()

Returns a temporary buffer of items that would be received if the entity was mined similar to on_player_mined_entity.

This would save a lot of hassle from trying to get all the products and contents and doing stuff with them.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13225
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: luaEntity.get_mining_results()

Post by Rseding91 »

What's the use case?

There's already an "entity_mined" event that contains all of the items (and the entity) in an inventory you can manipulate.
If you want to get ahold of me I'm almost always on Discord.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: luaEntity.get_mining_results()

Post by Nexela »

Getting results from a script that destroys() the item.

Right now I run through a function to loop through prototype products and build simple item stacks. Then I add all of the items from all the inventorys, inserter_hand etc of the entity

With the buffer I would be able to check that everything fits and increment/decrement the entity stacks/player stacks before destroying() the entity.

Post Reply

Return to “Modding interface requests”