#How to loop through all of a mod's blocks?

5 messages · Page 1 of 1 (latest)

random lion
#

Playing with Pretty in Pink, a mod which contains only blocks, and getting very annoyed at how its steel recycling works. All of the blocks in the mod cost half an iron ingot, but all of their stonecutting recipes recycle them into 2 iron nuggets. I'd like to remove all of the mod's recipes, then loop through every block to add recipes back. How do I loop through everything in a mod for tag adding/recipe adding?

rocky owlBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

terse forge
#

If it only add blocks you can just do

Ingredient.of("@mod").itemIds.forEach(item => {
})
random lion
#

oh wonderful! exactly what i needed, thank you very much!!!

#

final code snippet in case this helps anyone else:

ServerEvents.tags('item', event => {
    event.add('pretty_in_pink:steel', '@pretty_in_pink')
})

ServerEvents.recipes(event => {
    event.remove({type: 'minecraft:stonecutting', output: 'iron_nugget' })
    event.remove({type: 'minecraft:stonecutting', not: {input: 'iron_ingot'}, output: 'pretty_in_pink:white_steel_block' })
    event.remove({type: 'minecraft:stonecutting', not: {input: 'iron_ingot'}, output: 'pretty_in_pink:white_corrugated_steel' })
    event.remove({type: 'minecraft:stonecutting', not: {input: 'iron_ingot'}, output: 'pretty_in_pink:white_steel_tank' })
    event.remove({type: 'minecraft:stonecutting', not: {input: 'iron_ingot'}, output: 'pretty_in_pink:white_brushed_steel' })
    event.remove({type: 'minecraft:stonecutting', not: {input: 'iron_ingot'}, output: 'pretty_in_pink:white_steel_boiler' })
    event.remove({type: 'minecraft:stonecutting', not: {input: 'iron_ingot'}, output: 'pretty_in_pink:white_steel_hull' })
    event.remove({type: 'minecraft:stonecutting', not: {input: 'iron_ingot'}, output: 'pretty_in_pink:white_brushed_steel_hull' })
    
    Ingredient.of("@pretty_in_pink").itemIds.forEach(item => {
        event.stonecutting(item, '#pretty_in_pink:steel')
    });
})```