So there's a common refrain from a lot of players of "I have a ton of sand/fine sand/cobblestone/dirt/etc. and nothing to do with it but trash it!". One of the neat conveniences in Terraria was the Extractionator - a device that took "worthless" silt and slush and turned it into random outputs - pre-hardmode ores, small amounts of cash, etc. I want to recreate this, in a way, as part of a bigger mod (tl,dr: crush sandstone into saltpeter, make bombs from it once you have obtained a bomb for the first time), in so much as this material extractor would let you put in some quantity of dirt, fine sand, whatever and get something out of it, defined by treasure tables, I guess. The question then becomes, can you get random outputs from a recipe, given static inputs? If so, how?
Hmmm, my hunch would be that 'random' recipes won't work. Perhaps you could make something that doesn't craft as such, but instead it could destroy the contents and then use world.placeObject() (I think there's a function called something like that!) to randomly generate a result
I had a little look at doing it and the API doesn't seem like there's a way of even hacking this at the moment
I think there is an item in game that does something similiar but with ores? I'll search through the files, if I find it i'll edit this post.
.recipe files are static. You're not getting one to spit out random items. At least, I don't think it's possible. You probably could, however, make an object that spat out random items using an attached .lua script and world.spawnItem calls.
Yeah - like I said, the API is not quite rich enough for this yet, I couldn't find a way of getting a container to destroy it's contents.