Is there an Animal Breed Event?

Discussion in 'Plugin Development' started by ronedri, Mar 10, 2013.

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

    ronedri

    Hey :)
    Is there an Animal Breed Event? if not, how can I detect when a player breeds 2 animals?
    Thanks :p
     
  2. Offline

    ZeusAllMighty11

    CreatureSpawnEvent ?

    Edit: Yep
    BREEDING
    When an animal breeds to create a child
     
  3. Offline

    ronedri

    Thanks, but how can I get the player if I use this:
    Code:
    if (event.getSpawnReason().equals(SpawnReason.BREEDING))
     
  4. Offline

    RainoBoy97

    EntityMakeLoveEvent
     
  5. Offline

    ronedri

    Is there any chance to get the player in the event: CreatureSpawnEvent ?
     
  6. Offline

    ZeusAllMighty11

  7. Offline

    ronedri

    So I cant get a player that breeds two animals?
     
  8. old thread but......
    save player info and UUID of animals and compare on breeding event.
     
  9. xtremetom
    Old thread, as you said. No need to bump it just to say that.

    My suggestion would be either CreatureSpawnEvent (check the cause), ItemConsumeEvent (check the consumed item), or EntityInteractEntityEvent (check interacted entity).
     
  10. I had to do something similar once, I think what I did was grab the location of the animal and search for the player closest to them, additional checks such as whether or not the player has food in their hands can help find the breeder in a crowd of people.
     
Thread Status:
Not open for further replies.

Share This Page