Adding Enchants to Mob Equipment

Discussion in 'Plugin Development' started by bballheat, May 24, 2013.

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

    bballheat

    I've been trying to have my mobs spawn with armor and swords etc and finally got it working, but am having trouble adding enchantments to the equipment. Please help me if you can!
     
  2. Offline

    caseif

    Add the enchantments to the ItemStacks you're setting as the mobs' armor with .addEnchantment().
     
  3. Offline

    bballheat

    Code:
                    zombie.getEquipment().setItemInHand(new ItemStack(Material.STICK, 1).addEnchantment(Enchantment.DAMAGE_ALL, 5));
    Ok. The reason mine wasn't working is because I don't think you can enchant sticks :(
     
Thread Status:
Not open for further replies.

Share This Page