I'm also trying to addEnchantment to itemstacks after identifying an enchantment. For some reason this will not enchant the item for some reason. Enchantment enchant = (whatever enchantment your getting) Itemstack item = (wherever your getting the item) item.addenchantment(enchant, enchant.getMaxLevel())); ect. I didn't think it would work under itemstack but hey I figured that since its there try it. However this is a pretty much a nogo.
I got it figured out. Here guys for your info. I went through every available setup. Each Comment is what the target works for and only that target for safe adding of enchantments. Code: Enchantment.DAMAGE_ALL; //Weapons Only Enchantment.DAMAGE_ARTHROPODS; //Weapons Only Enchantment.DAMAGE_UNDEAD; //Weapons Only Enchantment.DIG_SPEED; //Tools except Hoe. Enchantment.DURABILITY; //Tools except Hoe. Enchantment.FIRE_ASPECT; //Weapons Only Enchantment.KNOCKBACK; //Weapons Only Enchantment.LOOT_BONUS_BLOCKS; //Tools except Hoe. Enchantment.LOOT_BONUS_MOBS; //Weapons Only Enchantment.OXYGEN; //Armor Helmet Only Enchantment.PROTECTION_ENVIRONMENTAL; //All Armor Enchantment.PROTECTION_EXPLOSIONS; //All Armor Enchantment.PROTECTION_FALL; //All Armor Enchantment.PROTECTION_FIRE; //All Armor Enchantment.PROTECTION_PROJECTILE; //All Armor Enchantment.SILK_TOUCH; //Tools except Hoe Enchantment.WATER_WORKER; //Armor Helmet Only At least I got enough info to push "Identify" out. http://dev.bukkit.org/server-mods/identify/