#Smelting Result By ID
15 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
What would this be useful for?
As this may be an XY problem
The XY problem is when you really want to do X, and you think that Y can achieve X. However, you can't get Y to work, and so ask for help exclusively about Y.
This can lead to a lot of confusion from the people trying to help you, as Y can seem like a very random thing to want to do, and a lot of the time isn't the best way to achieve X anyway.
Its fine to ask about Y, just always include some context about X so you can be put on the right track if Y won't do X well, or there is an easier way to do X.
I'm trying to overhaul ore processing in my greg pack, and i need to get their smelting results for more advanced ore factories
There is event.forEachRecipe which may help you
yeah but it iterates over all recipes, and it will get laggy pretty quick
You can specify the recipe filter, and do stuff depending on recipe's inputs, outputs, id, etc.
What did you expect? You have to iterate over recipes to get one concrete one
well i thought that maybe with input item and the recipe type out of the way, there would be a way to avoid iterating over all recipes
but thanks for letting me know, appreciate it :)
This is an example of how to use .forEachRecipe() for changing or adding new recipes using existing ones.
ServerEvents.recipes(e => {
// 2x slabs -> 1x plank through shaped crafting
e.forEachRecipe({ type: 'minecraft:crafting_shaped', output: '#minecraft:slabs' }, r => {
let ingredients = r.originalRecipeIngredients // returns a List<Ingredient>
let output = r.originalRecipeResult // returns an ItemStack
e.shaped(ingredients[0], ['S', 'S'], { S: output })
})
// 1x stair -> 1x plank through stonecutting
e.forEachRecipe({ type: 'minecraft:stonecutting', output: '#minecraft:stairs' }, r => {
let ingredients = r.originalRecipeIngredients
let output = r.originalRecipeResult
e.stonecutting(ingredients[0], output)
})
// change the output from logs to planks from 4x to 2x (this will replace old recipe)
e.forEachRecipe({ type: 'minecraft:crafting_shapeless', input: '#minecraft:logs', output: '#minecraft:planks' }, r => {
let ingredients = r.originalRecipeIngredients
let output = r.originalRecipeResult
e.shapeless(Item.of(output.id, 2), ingredients[0]).id(r.getId())
})
})
e stands for event, r stands for recipe
yeah i get the grip, thank you
Please close your ticket (with </ticket close:1054771505520717835> or the button atop this thread) once you resolved your issue!
This also helps others that would like to help out, as they don't have to look into this thread to check if it has been resolved by now.
Do you have any other questions regarding your issue? Feel free to ask!
Note: You should create a new post for unrelated issues.