#Add an enchantment to a custom item

16 messages · Page 1 of 1 (latest)

versed quarry
#

How can I add an enchantment to an item that has not yet been crafted? I want to add thorns enchantment to my modified Chainmail armor

with the Item Modification event is it possible?

ItemEvents.modification(event => {

dark willowBOT
#

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

versed quarry
#

Add an enchantment to a custom item

winged dirge
#

You could just modify the recipe

#

If that's sufficient

#

Or do you need to make the item always have this enchantment?

versed quarry
# winged dirge Or do you need to make the item always have this enchantment?

At first I wanted the item to have a thorns attribute but I failed miserably in making it work, I thought about the possibility of adding the thorns enchantment to the item, and then removing the enchantment's glow and renaming the tooltip so that it looks like an attribute like any other, I want this enchantment/attribute to work all the time on the chaimail item

#

Here's how I tried to register the attribute and its modifiers, if you have an idea on how to make this work, through registering a new custom attribute, or doing it through the enchantment itself

#

There are 3 different scripts, 1 to register the attribute, another to add functionality through the hurt event whenever an entity attacks the player, and the other adds the modified attribute to the item and the tooltip

winged dirge
#

I've never tried making a custom attribute but why are you treating the chest plate like a helmet?

versed quarry
#

At first it seems to have worked, it correctly registered the attribute in the game, but the hurt event seems to do nothing, it does not return the damage to the entities.

versed quarry
versed quarry
versed quarry
winged dirge
#

I think your attribute method is better

#

Does anything appear in your log