Enchantments

Discussion in 'Plugin Development' started by Deathmarine, Dec 1, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Deathmarine Retired Staff

    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.
     
  2. Offline

    Daniel Heppner

    You're not providing enough information. Also, is this a question? I don't see a question in there.
     
  3. Offline

    Deathmarine Retired Staff

    Sorry... Does anyone know if this function even works?
     
  4. Offline

    Deathmarine Retired Staff

    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/
     
  5. Offline

    Pandemoneus

  6. Offline

    Deathmarine Retired Staff

    LOL... Well that sucks... as well as 3 hours of life I can't get back..
     
Thread Status:
Not open for further replies.

Share This Page