You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
722 B
20 lines
722 B
// priority: 0 |
|
|
|
onEvent("recipes", event => { |
|
// For each stair crafting recipe that outputs 4x stairs, ... |
|
event.forEachRecipe({ id: /_stairs/, type: "minecraft:crafting_shaped" }, recipe => { |
|
if (recipe.outputItems[0].getCount() != 4) return; |
|
|
|
let input = recipe.inputItems[0]; |
|
let output = recipe.outputItems[0].getId(); |
|
|
|
// ... modify the output to return 6x instead of 4x. |
|
recipe.replaceOutput(output, "6x " + output, false, (out, orig) => out); |
|
|
|
// ... add a recipe to craft stairs in 2x2 crafting grid. |
|
event.shaped("3x " + output, [ "B ", "BB" ], { B: input }); |
|
|
|
// ... add a back-crafting recipe to turn 1x stair => 1x block. |
|
event.shapeless(input, [ output ]); |
|
}); |
|
});
|
|
|