Item Strings

Discussion in 'Plugin Development' started by inventorman101, Dec 22, 2012.

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

    inventorman101

    How do you give a certain item a name, add color to the text and give it enchantements
     
  2. Offline

    tommycake50

    as for enchantments itemstack.enchant(enchantment, level);
    for the others use itemMeta
     
  3. Offline

    gomeow

    Old method to set name:
    Code:java
    1. ((CraftItemStack)itemstack).getHandle().c("new name"); //outside of API

    New method:
    Code:java
    1. ItemStack is = new ItemStack(Material.DIAMOND_SWORD, 1);
    2. ItemMeta im = is.getItemMeta();
    3. im.setDisplayName("new name");
    4. is.setItemMeta(im);
     
Thread Status:
Not open for further replies.

Share This Page