RecipePrototype::single_use

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
thesixthroc
Fast Inserter
Fast Inserter
Posts: 150
Joined: Wed Apr 29, 2020 9:53 pm
Contact:

RecipePrototype::single_use

Post by thesixthroc »

Several times I have wanted to give the player a handcrafting recipe that they are only supposed to craft once. The recipe is disabled by script after they craft it (nowadays likely by a spoilage trigger), and a script processes the player's crafting queue to cancel any additional crafts of the one-off recipe.

What cannot currently be prevented is that such recipes will appear with a '41' in the lower-right corner of the Crafting window icon if the player has 41x the ingredients it needs.

As a fairly minimal proposal, RecipePrototype::single_craft could remove the small number and also prevent characters adding more than 1 of this recipe to their crafting queue. For non-character crafters I assume it has no effect.
Last edited by thesixthroc on Sat Feb 14, 2026 5:33 pm, edited 2 times in total.
User avatar
Osmo
Fast Inserter
Fast Inserter
Posts: 235
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: RecipePrototype::single_craft

Post by Osmo »

You can cancel cancel crafts in progress to leave only one https://lua-api.factorio.com/latest/cla ... l_crafting
thesixthroc
Fast Inserter
Fast Inserter
Posts: 150
Joined: Wed Apr 29, 2020 9:53 pm
Contact:

Re: RecipePrototype::single_craft

Post by thesixthroc »

That is addressed in the OP.
User avatar
Osmo
Fast Inserter
Fast Inserter
Posts: 235
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: RecipePrototype::single_craft

Post by Osmo »

thesixthroc wrote: Fri Feb 13, 2026 6:04 pm That is addressed in the OP.
I thought you meant 41 displaying in the crafting queue, nevermind
Post Reply

Return to “Modding interface requests”