This is something pretty specific due to my modpack having custom rarities; I'm using js Ingredient.all.itemIds.forEach(item => etc... to "browse" through all items and change the rarities depending on their similar value (Common > Mundane for example), the issue is, iron's spellbooks doesn't have public instance fields or methods related to rarity (or called rarity) on a similar way to all other vanilla/modded items, so, is there any way to ignore that specific mod on the event.modify iteration?
#Removing specific mod/class from Ingredient.all
7 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
just in case
Paste version of startup.log, awakened_item_modifications.js from @onyx glade
You could use a regex with an negative lookahead. Ingredient.of(/^(?!minecraft:).*$/).itemIds.forEach((item) => console.log(item) ); This example gets every id except for any id that starts with 'minecraft:'. Instead of '(?!minecraft:)' you should use the id the spellbook items start with.
funny enough, most items return a rarity of undefined xD
Then just test whether rarity exists? Ingredient.all.itemIds.forEach((item) => event.modify(item, (i) => { //test if i has key rarity if (!i.hasOwnProperty('rarity')) return; if ( i.rarity == 'COMMON' || i.rarity == 'common' || i.rarity == 'RARITY.COMMON' ) { i.rarity = 'MUNDANE'; } else if ( i.rarity == 'UNCOMMON' || i.rarity == 'uncommon' || i.rarity == 'RARITY.UNCOMMON' ) { i.rarity = 'UNUSUAL'; } else if ( i.rarity == 'RARE' || i.rarity == 'rare' || i.rarity == 'RARITY.RARE' ) { i.rarity = 'REMARKABLE'; } else if ( i.rarity == 'EPIC' || i.rarity == 'epic' || i.rarity == 'RARITY.EPIC' ) { i.rarity = 'UNIQUE'; } }) );