So in this script we're defining the nbt of spell scrolls and it works for those. however there are also these spell books with similar nbt data, im wondering if its as simple as changing a few let values ```js
ItemEvents.rightClicked('irons_spellbooks:scroll',e => {
const {item, player, level} = e
// Get Scroll Stuff
let nbt = item.nbt
let scrollLevel = nbt?.ISB_spell?.level
let scrollType = nbt?.ISB_spell.type
if(scrollLevel == 1) return // Early return for beginner Scrolls
// Get Powers
let originsOrigin = player.nbt.ForgeCaps['apoli:powers']
let types = {
fire: [2, 33, 59, 1, 10],
ender: [60, 44, 42, 4, 3, 21, 30],
blood: [8, 22, 25, 26, 29, 57, 39, 58, 66],
evocation: [9, 13, 14, 16, 19, 20, 31, 32, 38, 45, 64],
holy: [7, 15, 18, 27, 41, 43, 61, 62],
ice: [6, 12, 34, 40, 48],
lightning: [5, 23, 24, 37, 46, 65],
void: [35, 47, 56],
poison: [49, 50, 51, 52, 53, 54, 55]
}
// Get TypeKey
let resultKey = Object.keys(types).find(key => types[key].includes(scrollType));
// Crosscheck element and level
for(let i = 0; i < originsOrigin['Powers'].length; i++){
let power = originsOrigin['Powers'][i].Type
let element = power.split('/')[0].split(':')[1]
let powerType = power.split('/')[1].replace('lvl', '')
if(resultKey == element && scrollLevel == powerType) return
}
e.cancel()
})mainly thesejs
let scrollLevel = nbt?.ISB_spell?.level
let scrollType = nbt?.ISB_spell.type``` ive attatched the 2 nbt datas in the post and the scroll is the one being used in the code tazz simplified
