Reducing Duration Of All Machine Recipes
Reducing Script
Reduce_Duration.js
ServerEvents.recipes(event => {
event.forEachRecipe({ mod: 'gtceu' }, recipe => { // (1)
try { // (2)
var newDuration = recipe.get("duration") // (3)
recipe.set("duration", newDuration/10) // (4)
} catch (err) { // (5)
console.log(recipe.id + " has no duration field, skipped.")
}
})
})
- A function to run code for every recipe in gregtech.
- Uses a try to avoid using recipes that don't have a duration, like crafting.
- Gets a variable of the duration current duration to change.
- Edits the recipes duration to a tenth of the old recipes duration.
- Catches the error if the recipe has no duration and logs it.