Solved how do i name an item

Discussion in 'Plugin Development' started by Deaven, Aug 9, 2016.

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

    Deaven

    i have been trying different methods i have tried hub.getItemMeta().setDisplayName("§e§lServer Selector");
    but that was not working for me anyone have any suggestions?
     
  2. Offline

    Blockhead7360

    It should work if you get the ItemMeta by itself first, and then set the display name. After that, set the item's ItemMeta:

    Example:
    Code:
    ItemStack hub = new ItemStack(Material.BARRIER, 1);
            ItemMeta meta = hub.getItemMeta();
            meta.setDisplayName(ChatColor.YELLOW + "" + ChatColor.BOLD + "Server Selector");
            hub.setItemMeta(meta);
     
  3. Offline

    Deaven

    thank you :)
     
Thread Status:
Not open for further replies.

Share This Page