Do you mean setting an italic color format onto the display name of the item? Can you be more specific?
Code:java public ItemStack testItem() { List<String> lores = new ArrayList<String>(); lores.clear(); lores.add(ChatColor.GREEN + "" + ChatColor.ITALIC + "Yolo swaggins!"); ItemStack item = new ItemStack(Material.DIAMOND_SPADE, 1); ItemMeta im = item.getItemMeta(); im.setDisplayName(ChatColor.GOLD + "" + ChatColor.ITALIC + "Swag."); im.setLore(lores); item.setItemMeta(im); return item;} There's a nice little example code for you.
Heh, whoops. I meant, Italics color format, ChatColor.ITALIC + "insert name here" on ItemMeta of an ItemStack.
Code:java ItemStack item = new ItemStack(Material.STONE, 1);ItemMeta meta = item.getItemMeta();meta.setDisplayName(ChatColor.ITALIC + "" + ChatColor.RED + "It now has an red italic name");List<String> lore = new ArrayList<String>();lore.add(ChatColor.ITALIC + "Italic Lore");meta.setLore(lore);item.setItemMeta(meta); And you have a Stone with an Italic, Red Display Name and an Italic Lore. Works on latest CB 1.7.2 build
Hm, Color works fine for me, but Italics/Matrix/Strikethrough/Underline don't. I will try again later and get back.
Ok my bad. Just tested it aswell. Only seems to work for the Lore. Doesn't work for the DisplayName either. Not sure if it is a bug or if it is meant that way. Sowwy
Thanks. Could be a bug with the API code, since I remember doing it before, and the name becomes italic when manually renamed through an anvil.
Not even close try it out yourself =P "The operator + is undefined for the argument type(s) org.bukkit.ChatColor, org.bukkit.ChatColor"
XvBaseballkidvX Yea, not gonna give the full explanation, but yea. That doesn't work. Nevertheless, even if you did it the right way, it doesn't seem to be working with ItemStack displaynames. Though it works in chat.
xigsag Always wondered about that... Maybe set a string to to have italics with color with the "&" symbol and translate it with Code:java ChatColor.translateAlternateColorCodes('&', stringhere);
I noticed that when an itemstack's displayname does not have a chatcolor in it, the italics automatically show up upon mouse-over. But with colors, they don't. Either way, italics does not show up on hotbar tooltip. I must be the most confused person in the world right now. Theory inb4 post did not happen to me after i tried to re-simulate the effect. I had recoded a class of a plugin I was making, but I am pretty sure I did not touch the strings that determine the name of the item. EDIT by Moderator: merged posts, please use the edit button instead of double posting.