Plugin Help ItemStack help

Discussion in 'Plugin Help/Development/Requests' started by haussik, Dec 3, 2014.

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

    haussik

    Here is my code:
    Code:java
    1. ItemStack itemStack = new ItemStack(Material.NETHER_STAR);
    2. ItemMeta itemMeta = itemStack.getItemMeta();
    3. itemMeta.setDisplayName(ChatColor.GOLD + "" + ChatColor.BOLD + ChatColor.UNDERLINE + "Lucky box +1");
    4. List<String> lore = itemMeta.getLore();
    5. lore.add(ChatColor.GRAY + "" + ChatColor.ITALIC + "Right click with this item to drop a rare item!");
    6. lore.add(ChatColor.GRAY + "" + ChatColor.ITALIC + "Lucky box +1, search for the Lucky box +5!");
    7. itemMeta.setLore(lore);
    8. itemStack.setItemMeta(itemMeta);
    9.  
    10. event.getDrops().clear();
    11. event.setDroppedExp(10);
    12. event.getDrops().add(new ItemStack(itemStack));


    Everything work without the part that i want a custom item. But how can i have a mob to drop my custom item that i want ?

    Sorry for my english :p

    I removed
    Code:java
    1. List<String> lore = itemMeta.getLore();
    2. lore.add(ChatColor.GRAY + "" + ChatColor.ITALIC + "Right click with this item to drop a rare item!");
    3. lore.add(ChatColor.GRAY + "" + ChatColor.ITALIC + "Lucky box +1, search for the Lucky box +5!");
    4. itemMeta.setLore(lore);


    And everything is fine, but i would know why this is not working with a custom lore ? ( drop from entity )

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 29, 2016
Thread Status:
Not open for further replies.

Share This Page