How can i get Wool Color?

Discussion in 'Plugin Development' started by GyD, Mar 7, 2011.

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


    I'm having issues, i'm trying to get the wool color in a chest.

    This code return me WHITE event if the color is BLACK:

    item = chest.getInventory().getItem(i);
     	                if( item.getType() == Material.WOOL )
    	                	MaterialData data = item.getData();
    	                	if (data instanceof Wool) {
    	                	    Wool wool = (Wool)data;
    	                	    seller.sendMessage("You have a " + wool.getColor() + " wool!");
    Maybe I miss something but i don't find how to solve this.

    Tank you for you help
  2. Offline


  3. Offline

    Dinnerbone Bukkit Team Member

    Huh. That's the correct method, I'm going to say bug. Does it always return white?
  4. Offline


    Yes (but i only tested purple, brown and green wool) , i'll use "(byte)item.getDurability();" for now it work ^^
Thread Status:
Not open for further replies.

Share This Page