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

ItemStack.setData() is not working?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Minor Minor
    • None
    • None

      because the DyeColor enum's getData() method is separated into two getWoolData() and getDyeData() (they are deprecated anyway), I recently changed my code like below:

      new ItemStack(Material.WOOL, 1, DyeColor.GREEN.getData());

      to

      new ItemStack(Material.WOOL, 1){{
      setData(new Wool(DyeColor.GREEN));
      }};

      and the actual item I see is just a white wool instead of green wool

      did I do something wrong? or is it a bug in 1.11?

            Unassigned Unassigned
            wysohn wysohn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: