Page 1 of 1

How do I craft a given item from lua?

Posted: Sun Mar 13, 2016 9:31 am
by Mythbrion
Hi there,
Just trying to find the method that is called when you click an item to craft.
I realise there is an insert command to place an item in the player's inventory, but I would like to be able to have an item begin crafting on a condition set in a mod.
Hoping there is a simple 'player.craft(itemname, quantity)' style solution, but I couldn't find the code to do it.
Any help would be much appreciated.

Thank you.

Re: How do I craft a given item from lua?

Posted: Wed Mar 16, 2016 3:15 am
by Mythbrion
No one has any info?
Is this something we don't have access to from code?
Any information welcome, or perhaps a work around to emulate crafting an item, taking out mats, waiting a time, then inserting the desired item perhaps.
Messy but might work if there is no way to trigger a player to craft.

Re: How do I craft a given item from lua?

Posted: Wed Mar 16, 2016 3:25 am
by keyboardhack
You can find all the methods that modify a player here. By the looks of it it doeesn't look like it's possible to force a player to craft something. You can ask the devs to make it possible by making a post about it here.

Re: How do I craft a given item from lua?

Posted: Wed Mar 16, 2016 7:20 am
by Mythbrion
Thank you very much! I will make a topic requesting it there.