Let's assume an item is added to the crafting queue that causes multiple items to appear in the crafting queue because the player doesn't have all the direct ingredients for it. For example after adding a solar-panel-equipment the crafting queue might look like this:
Given the description of the documentation if I call
I would expect one of the copper cables to be removed from the queue. What happens instead is that the entire queue gets cancelled because the "cancel_crafting" seems to look at the queue of composite items that were added through "begin_crafting" instead.
With other words it only considers items that are not a prerequisite to be cancelled. All other items would only indirectly be affected.
Many thanks!
cancel_crafting works in unexpected ways
-
galgtonold
- Manual Inserter

- Posts: 2
- Joined: Tue Dec 16, 2025 3:50 pm
- Contact:
Re: cancel_crafting works in unexpected ways
How it works:
When starting any given craft the game will also queue any required items to craft the original request. If one or more of those dependencies are cancelled then the original craft is updated to show the reduced total. If you ask for an iron chest and it needs 1 iron plate crafted, and you cancel the iron plate - the chest obviously can't be crafted. (just an example).
This is what "prerequisite" in the read data means: it is a prerequisite of a later crafting queue entry.
By removing one of the copper cables it's causing one of the electronic circuits to be cancelled which makes the total crafted insufficient for the solar panel which cancels that which cancels the entire queue because the solar panel is what caused all previous crafting entries to exist.
When starting any given craft the game will also queue any required items to craft the original request. If one or more of those dependencies are cancelled then the original craft is updated to show the reduced total. If you ask for an iron chest and it needs 1 iron plate crafted, and you cancel the iron plate - the chest obviously can't be crafted. (just an example).
This is what "prerequisite" in the read data means: it is a prerequisite of a later crafting queue entry.
By removing one of the copper cables it's causing one of the electronic circuits to be cancelled which makes the total crafted insufficient for the solar panel which cancels that which cancels the entire queue because the solar panel is what caused all previous crafting entries to exist.
If you want to get ahold of me I'm almost always on Discord.
Re: cancel_crafting works in unexpected ways
And it works the same as the player manually cancelling. That's hardly unexpected.
-
galgtonold
- Manual Inserter

- Posts: 2
- Joined: Tue Dec 16, 2025 3:50 pm
- Contact:
Re: cancel_crafting works in unexpected ways
Thanks for elaborating, that makes sense from a logical standpoint!
I guess I was thinking about it too naively, expecting it to behave like a list that you modify.
I guess I was thinking about it too naively, expecting it to behave like a list that you modify.

