Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-2745

Changing a potion display name makes it lose all effects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • None
    • Centos 7
      JDK 8u101

    • None

      After changing the potion or monster egg display name the item will lost all its attributes (see attachment).

      Code:

                      ItemStack pot1 = new ItemStack(Material.POTION, 1, (short) 16378);
                      ItemStack egg1 = new ItemStack(Material.MONSTER_EGG, 1, (short) 90);
                      
                      ItemStack egg2 = new ItemStack(Material.MONSTER_EGG, 1, (short) 90);
                      ItemMeta meta = egg2.getItemMeta();
                      meta.setDisplayName("EGG");
                      egg2.setItemMeta(meta);
                      
                      ItemStack pot2 = new ItemStack(Material.POTION, 1, (short) 16378);
                      ItemMeta meta2 = pot2.getItemMeta();
                      meta2.setDisplayName("POTION");
                      pot2.setItemMeta(meta2);
                      
                      Inventory inv = Bukkit.createInventory(null, 54);
                      inv.addItem(pot1.clone(), egg1.clone(), pot2.clone(), egg2.clone());
                      p.openInventory(inv);
                      
                      p.getInventory().addItem(pot1, egg1, pot2, egg2);
      

            Unassigned Unassigned
            FurmigaHumana Furmiga Humana
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: