The api clearly say that on_preplayer_mined_item fire when the player start mining something
Yet it actually fire on the same tick # as on_preplayer_mined_item, right before the entity is deleted."Called when the player starts mining something"
http://lua-api.factorio.com/latest/even ... mined_item
so it's goes like this
- item start being mined
- mining progress bar reach 100%
- [...]
- tick begin
- [...]
- on_preplayer_mined_item is fired with the entity as a parameter
- entity is removed from the memory by the c++ logic.
- on_player_mined_item is fired with the result item_stack as a parameter
- [...]
- tick end
- [...]
Is this a bug or really a very niche case event with a wrong description? if it's not a bug can we get a proper event that fire when the player start mining something so we can do stuff like setting entity.minable to false and stop the mining. Or maybe remove the mining-tool from the tool_inventory. Something like that.
forum post where I'm describing what i'm trying to achieve -> viewtopic.php?f=25&t=31853
Thanks!