This should work

Discussion in 'Plugin Development' started by john2342, Aug 2, 2014.

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

    john2342

    I made this and it pop
    Code:
    ItemStack donork = new ItemStack(Material.DIAMOND_BLOCK, 1);
            ItemMeta im = donork.getItemMeta();
            ArrayList<String> idesc1 = new ArrayList<String>();
            if(!donorkit.contains(p.getName())) {
                im.setDisplayName("§3§lPremium kit §c§l(Locked)");
                idesc1.add("§c§lThis is a premium kit!");
                idesc1.add("§c§ldonate at| §6§lnull");
            }else{
                im.setDisplayName("§3§lPremium kit §2§l(Unlocked)");
                idesc1.add("§6§lRight click to activate");
                idesc1.add("§6§lthis kit!");
    s up in the inventory, but doesn't have a description or name, it's just a normal diamond block, I removed the if and else statement as a test, but still no luck so it's the itemstack.

    Btw § worked on my other itemstacks, so it's not that

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  2. Offline

    mythbusterma

    john2342

    Use the ChatColor enum instead of the sign character.
     
    Gerov likes this.
  3. Offline

    Gerov

    john2342 Did you set the donork's ItemMeta to im?

    donork.setItemMeta(im);
     
  4. Offline

    john2342

    Gerov that just gave me an error
     
  5. Offline

    Gerov

    john2342 Do you mind say what the error is?
     
Thread Status:
Not open for further replies.

Share This Page