/** * Sets the name of the next item to be modified on this anvil. * * @param name the item name */ public void setRenameText(String name) { renameText = name; if (renameText.isEmpty()) { setItem(FIRST_ITEM_SLOT, getFirstItem()); setItem(SECOND_ITEM_SLOT, getSecondItem()); } else { ItemStack result = getFirstItem().clone(); if (!InventoryUtil.isEmpty(result)) { if (Objects.equals(result.getItemMeta().getDisplayName(), name)) { setItem(RESULT_SLOT, InventoryUtil.createEmptyStack()); } // rename the item ItemMeta m = result.getItemMeta(); m.setDisplayName(ChatColor.ITALIC + renameText); result.setItemMeta(m); setItem(RESULT_SLOT, result); } } } }
ItemStack i = new ItemStack(Material.PACKED_ICE); ItemMeta m = i.getItemMeta(); m.setDisplayName("CustomDisplayName") List<String> l = new ArrayList<String>(); l.add("Line 1"); l.add("Line 2"); m.setLore(l); i.setItemMeta(m); ShapedRecipe packedice = new ShapedRecipe(i);
String[] kits = getConfig().getString("Kits." + args[0] + ".Items").split(","); String[] itemNames = getConfig().getString("Kits." + args[0] + ".names").split(","); for (int i = 0; i < kits.length; i++) { String[] singleKits = kits[i].split("-"); ItemStack kit = new ItemStack(Integer.valueOf(singleKits[0]), Integer.valueOf(singleKits[1])); ItemMeta kitDisplayName = kit.getItemMeta(); kitDisplayName.setDisplayName(itemNames[i]); kit.setItemMeta(kitDisplayName); }
public ItemBuilder setName(String name, boolean color) { this.itemMeta.setDisplayName(color ? ChatUtils.colored(name) : name); this.refreshMeta(); return this; }
private void parseCustomName() { String name = ChatColor.translateAlternateColorCodes('&', this.linkedSection.get("name").toString()); ItemMeta im = this.finalStack.getItemMeta(); im.setDisplayName(name); this.finalStack.setItemMeta(im); }
private void parseCustomName() { String name = ChatColor.translateAlternateColorCodes('&', this.linkedSection.get("name").toString()); ItemMeta im = this.finalStack.getItemMeta(); im.setDisplayName(name); this.finalStack.setItemMeta(im); }
public void setName(String name) { this.name = name; meta.setDisplayName(name); meta.setLocalizedName(name); //Localized name cannot be overridden by the player using an anvils icon.setItemMeta(meta); }
public IconMaker setDisplayName(String name) { ItemMeta m = this.item.getItemMeta(); m.setDisplayName(ChatColor.translateAlternateColorCodes('&', name)); this.item.setItemMeta(m); return this; }
public static ItemStack withName(Material material, String name, short variant) { ItemStack stack = new ItemStack(material, 1, variant); ItemMeta meta = stack.getItemMeta(); meta.setDisplayName(name); stack.setItemMeta(meta); return stack; }
// Imports and other code here... @EventHandler public void onPlayerJoin(PlayerJoinEvent e){ Player p = e.getPlayer(); ItemStack t = new ItemStack(Material.TNT); ItemMeta tmeta = t.getItemMeta(); tmeta.setDisplayName(ChatColor.RED + "TNT " + ChatColor.GRAY + "(Right click to use)"); t.setItemMeta(tmeta); p.getInventory().addItem(t); }
public static ItemStack getChimaeraWing(int amount) { ItemStack itemStack = new ItemStack(Config.getInstance().getChimaeraItem(), amount); ItemMeta itemMeta = itemStack.getItemMeta(); itemMeta.setDisplayName(ChatColor.GOLD + LocaleLoader.getString("Item.ChimaeraWing.Name")); List<String> itemLore = new ArrayList<String>(); itemLore.add("mcMMO Item"); itemLore.add(LocaleLoader.getString("Item.ChimaeraWing.Lore")); itemMeta.setLore(itemLore); itemStack.setItemMeta(itemMeta); return itemStack; }
TARDISRegulatorSlot() { box = new ItemStack(Material.BLUE_WOOL, 1); ItemMeta ler = box.getItemMeta(); ler.setDisplayName("Regulator"); box.setItemMeta(ler); vortex = new ItemStack(Material.BLACK_STAINED_GLASS_PANE, 1); }
private ItemStack getCancelItemStack() { ItemStack glowstone = new ItemStack(this.getActivatedMaterial(), 1); ItemMeta meta = glowstone.getItemMeta(); meta.setDisplayName(BedwarsRel._l("ingame.specials.warp-powder.cancel")); glowstone.setItemMeta(meta); return glowstone; }
private ItemStack getCancelItemStack() { ItemStack glowstone = new ItemStack(this.getActivatedMaterial(), 1); ItemMeta meta = glowstone.getItemMeta(); meta.setDisplayName(BedwarsRel._l("ingame.specials.warp-powder.cancel")); glowstone.setItemMeta(meta); return glowstone; }
public void addReduceCountdownItem() { ItemStack reduceCountdownItem = new ItemStack(Material.EMERALD, 1); ItemMeta im = reduceCountdownItem.getItemMeta(); im.setDisplayName(BedwarsRel._l(player, "lobby.reduce_countdown")); reduceCountdownItem.setItemMeta(im); this.player.getInventory().addItem(reduceCountdownItem); }
public void addGameStartItem() { ItemStack startGame = new ItemStack(Material.DIAMOND, 1); ItemMeta im = startGame.getItemMeta(); im.setDisplayName(BedwarsRel._l(player, "lobby.startgame")); startGame.setItemMeta(im); this.player.getInventory().addItem(startGame); }
public ItemStack createItem(Material material, int amount, short datavalue, String name, List<String> lore) { ItemStack item = new ItemStack(material, amount, datavalue); ItemMeta meta = item.getItemMeta(); meta.setDisplayName(color(name)); meta.setLore(colorList(lore)); item.setItemMeta(meta); return item; }
public ItemBuilder colored() { if (itemMeta.hasDisplayName()) { itemMeta.setDisplayName(TLocale.Translate.setColored(itemMeta.getDisplayName())); } if (itemMeta.hasLore()) { itemMeta.setLore(TLocale.Translate.setColored(itemMeta.getLore())); } return this; }
@Override public void extractConfigurationParameters() { super.extractConfigurationParameters(); configHideNotReceivedCategories = mainConfig.getBoolean("HideNotReceivedCategories", false); configHideNoPermissionCategories = mainConfig.getBoolean("HideNoPermissionCategories", false); langListGUITitle = translateColorCodes(LangHelper.get(GuiLang.GUI_TITLE, langConfig)); ItemMeta itemMeta = lockedItem.getItemMeta(); itemMeta.setDisplayName(translateColorCodes("&8" + LangHelper.get(GuiLang.CATEGORY_NOT_UNLOCKED, langConfig))); lockedItem.setItemMeta(itemMeta); }
public ItemStack createLazyItem(Material material, int amount, short datavalue, String name, String lore) { ItemStack item = new ItemStack(material, amount, datavalue); ItemMeta meta = item.getItemMeta(); meta.setDisplayName(color(SavageFactions.plugin.getConfig().getString(name))); meta.setLore(colorList(SavageFactions.plugin.getConfig().getStringList(lore))); item.setItemMeta(meta); return item; }