Infinitely Enchanting Armor

Status
Fixed
Issue description

The only way I found to enchant armor is to put it in the tick event, which when you put it in there the armor enchants infinitely, lagging the game. Is there any way to have only one enchant, instead of infinite numbers of the same enchant? 

Issue comments

One option would be to use itemstack variables to store the fact the enhancement was applied, but in 1.9.0 there is a bug with these variables that will be fixed in 1.9.1.

Another option is to use a global trigger on item crafted, check if the crafted item was your armor and apply the enhancement there.

Just for future reference for other people I have made a quick image so others can see what Klemen means by the first solution

One option would be to use itemstack variables to store the fact the enhancement was applied, but in 1.9.0 there is a bug with these variables that will be fixed in 1.9.1.

Image of the first solution.