#Adding attributes from another mod onto existing items

12 messages · Page 1 of 1 (latest)

ancient fog
#

I'm trying to add Iron's Spells and Spellbooks attributes to existing weapons and armor.

ItemEvents.modification(event => {
    event.modify("minecraft:diamond_sword", item => {
        item.addAttribute("irons_spellbooks:max_mana", "Mana", 200)
    })
})  

It keeps saying addAttribute doesn't exist, how would I do it then?

And before you say it, no, I won't use Custom Item Attribute mod because it doesn't work at all.

bleak tartanBOT
#

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

wide hare
runic hollow
# wide hare Hi sorry to bother you, have you find a solution for this?

Just going by OP's script, it looks like the main problem is that they didn't include a UUID in the add attribute function. The game uses those to keep track of which attributes are seperate so it can stack multiple ones of the same type.

They also didn't specify how 200 should be applied to the max_mana attribute. Is 200 being added to the max? Is the max being multiplied by 200? Or is only the base 100 mana being multiplied by 200?

If I'm right, then the item.addAttribute function should have looked like

item.addAttribute("irons_spellbooks:max_mana", [UUID HERE], "Mana", 200, 'addition').

You can find UUID generators online quite easily. But if that doesn't help, I'd ask you make your own support thread for it. I'm only answering you here for when someone else runs into the same problem.

austere creek
wide hare
#

yes it worked

safe scarab
#

@limber sequoia idk if this is what you have but this thread might help

limber sequoia
#

Checked this thread, generated a uuid, didn't work. Do I need the iron's spells attribute-specific uuid?

safe scarab
#

i think so

limber sequoia
#

hrm