Will ChickenLayEggEvent ever get implemented?

Discussion in 'Bukkit Discussion' started by 123isme1, Jul 23, 2014.

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

    123isme1

  2. Offline

    Zettelkasten

    123isme1 likes this.
  3. Offline

    123isme1

    Zettelkasten
    Hopefully it will, it looks like it got revived only 4 days ago.
     
  4. Offline

    xTrollxDudex

    123isme1
    cough cough ItemSpawnEvent
     
  5. Offline

    123isme1

    ya... but it would be easier to use ChickenLayEggEvent because you already know it is an egg, and it came from a chicken
     
  6. Offline

    xTrollxDudex

    instanceof check much
     
  7. Offline

    123isme1

    Yes, I would lie to not have to do that.
    If you setCancel(true); ItemSpawnEvent will it also cancel the "plop" sound?
     
  8. Offline

    xTrollxDudex

    No. For that, use ProtocolLib. The sound is made before the egg is spawned.
     
  9. Offline

    123isme1

    I never considered ProtocolLib, I will have to try that

    I got confused when when reading the javadocs, I dont get ProtocolLib

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  10. Offline

    xTrollxDudex

    Have you looked at any examples?
     
  11. Offline

    tempelis

    If you are looking to capture the egg hatching event you can use this:
    Code:
    public void eggHatchEvent(PlayerEggThrowEvent e){
        if(e.isHatching()){
           
        }
     
  12. Offline

    Maximvdw

    thats only when throwing eggs that 'might' spawn a chicken.
    As for protocollib its an external lib but extremely useful
     
  13. Offline

    tempelis

    Code:java
    1. public void eggHatchEvent(PlayerEggThrowEvent e){
    2. e.setHatching(true);
    3. if(e.isHatching()){
    4. ...
    5. }
    6. }

    You can also just do this if you want them to hatch all of the time then set an event to it. In my personal opinion, I don't like these extra libraries because when coding workarounds, it's better for learning your way around the pre-existing library and it will help you learn more, instead of just someone coding the extra library for you.
     
Thread Status:
Not open for further replies.

Share This Page