How do you get colored wool in an ItemStack?

Discussion in 'Plugin Development' started by BenPlaysMC, Jan 14, 2017.

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

    BenPlaysMC

    Hi there, I was already looking at a forum for this and I saw that getData() was deprecated and I wanted to make it easier to get colored wool.

    I have this so far:
    Code:
    ItemStack kickwool = new ItemStack(Material.WOOL, 1, DyeColor.YELLOW.getData());
    However, getData() is deprecated and I need a more efficient way to get colored wool,
     
  2. Offline

    Zombie_Striker

    @BenPlaysMC
    First, reflection does not mean you should not use it. getData should still work.

    If you really want to remove the deprecation warning, use Reflection. If the server version is 1.11 or higher, use getWoolData. If not, use data.
     
  3. Offline

    ipodtouch0218

    @Zombie_Striker
    By "reflection" don't you mean "deprecation"? (I'm guessing auto-correct had something to do with it.)
     
    Zombie_Striker likes this.
Thread Status:
Not open for further replies.

Share This Page