Solved Adding Items with Enchants to a player's inventory.

Discussion in 'Plugin Development' started by thapengwin, Apr 21, 2013.

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

    thapengwin

    I can't find this out, searched for a bit, so here's my question:
    How do I add Items with Enchantments to a player's Inventory? I know that it's something like .addUnsafeEnchantment(stuff, yeah). And oh, I'm adding an enchant to an item that can't get enchanted in vanilla (blaze rod). Any help?
     
  2. Try something like this:
    Itemstack item = new ItemStack(Material.BLAZE_ROD));
    item.addUnsafeEnchantment(Enchantment.LOOT, 1);
    player.getInventory.add.....
     
  3. Offline

    kreashenz

  4. Offline

    thapengwin

Thread Status:
Not open for further replies.

Share This Page