Why doesn't this work?

Discussion in 'Plugin Development' started by ParanormalX, Mar 17, 2013.

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

    ParanormalX

    Resolved.
     
  2. Offline

    AlexLeporiday

    Any errors? Is the event firing if you add debugging?
    If you haven't checked if the event is being called then do so and post your results.
    If the event isn't being called you didn't register it correctly. If the event is being called and erroring in the console then post it here.

    Try (I have no idea if this returns ANYTHING different than what you have but it's the method I'd used instinctively):
    if (evt.getEntity().getType() == EntityType.SHEEP) {
     
  3. Offline

    ZeusAllMighty11 Retired Staff

    Why not just do :
    Code:
    if(evt.getEntity() instanceof Sheep){
        Sheep sheep = (Sheep) evt.getEntity();
        sheep.setColor(DyeColor.PINK);
    }
    
     
  4. Offline

    ParanormalX

    Thanks that helped me a lot.
     
  5. Offline

    kaskoepoes112

    next time please don't change the first post to "Resolved" , maybe someone else has the same problem then this topic couldn't help him anymore because you changed the first post to "Resolved".
    Change the thread prefix to solved :) sorry if I was offtopic..
     
    Darq likes this.
Thread Status:
Not open for further replies.

Share This Page