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


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


    CreatureSpawnEvent ?

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


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


  5. Offline


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


  7. Offline


    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