Help with dye sheep listener

Discussion in 'Plugin Development' started by raGan., Oct 29, 2012.

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

    raGan.

    I whant to know when player dyes any sheep, but I don't see a way to obtain player in SheepDyeWoolEvent and PlayerInteractEntityEvent doesn't know if sheep was actually dyed. Additionally, DyeColor data values aren't the same as data values for ink sack, so checking item in hand seems inconvenient. Do you know about easy way to check if player actually dyed a sheep ? Thank you.
     
  2. Offline

    DarthSalamon

    You could use PlayerInteractEntityEvent, then check if the item in hand is a dye (ID: 351). And check if the entity is a Entity.SHEEP, that will get you what you want. (I think)
     
  3. Offline

    raGan.

    I know, but 351:2 is green dye and green DyeColor in bukkit is 13. It also passes when you use the dye on the sheep with the same color, but no dye is consumed, so additional check needs to be added there. I was just trying to find out if there was easier way to do it.
     
Thread Status:
Not open for further replies.

Share This Page