I've been working on a pack with both Iron's Spells JS and PowerfulJS, and I want to grant the player spells by wearing certain curios-Example, an eye of ender in a custom curio slot granting the player an extra spell to their selection.
I've tried using .addDefaultSpell on the Startup ItemEvents.modification event event.modify as well as nesting it inside an item.attachCapability but all options just seem to return errors. Based on T.O Tweaks I think it may be possible to do with NBT data but I'm not clear on how to do that if it is possible.
ItemEvents.modification(event => {
event.modify('minecraft:ender_eye', item => {
item.maxStackSize = 64
item.attachCapability(CuriosCapabilityBuilder.CURIOS.itemStack()
.canEquip(((item, context) => true))
.canUnequip(((item, context) => true))
.modifyAttribute("irons_spellbooks:cooldown_reduction", "cd_redu", 1, "addition")
.modifyAttribute("irons_spellbooks:max_mana", "mana_add", 1, "addition")
.modifyAttribute("minecraft:generic.attack_damage", "attack_damage", 1, "addition")
.modifyAttribute("minecraft:generic.attack_speed", "attack_speed", 1, "addition")
)
item.attachCapability("irons_spells_js:spellbook".itemStack()
.setMaxSpellSlots(4)
.addDefaultSpell(SpellRegistry.FIREBOLT_SPELL, 1)
)
item.fireResistant = true
item.rarity = 'UNCOMMON'
})
})
If anyone knows of a method to make this work, any help would be appreciated.