Solved Breeding

Discussion in 'Plugin Development' started by lol768, Aug 26, 2013.

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

    lol768

    Other than listening on the PlayerInteractEvent and checking held items, is there a way to stop players from breeding mobs together? Can this be achieved solely with the Bukkit API?
     
  2. Offline

    Samthelord1

    lol768 there is an animal spawn event, which has a spawnReason, one being breeding. http://jd.bukkit.org/rb/apidocs/org/bukkit/event/entity/CreatureSpawnEvent.SpawnReason.html#BREEDING or entityMakeLoveEvent, I believe they're both cancel able

    lol768 I advise listening for entity love, and cancelling it as you don't want them making love then no baby, unless you intend on using love as a feature of your plugin, hope I helped :)

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

    chasechocolate

  4. Offline

    Samthelord1

    chasechocolate personally, I advise not using that, but using the love event, or it could look somewhat unprofessional, or possibly listening for both, maybe the love cancels the hearts but not baby? I'm not sure, but I think love will cancel spawning from it aswell as the hearts.
     
  5. Offline

    chasechocolate

    Samthelord1 what's the love event? I think you should just cancel PlayerInteractEntityEvent as cancelling CreatureSpawnEvent can cause memory leaks.
     
  6. Offline

    Samthelord1

  7. Offline

    lol768

  8. Offline

    Samthelord1

    lol768 yeah, i'd use that, I did some research, there was a EntityMakeLoveEvent but I guess they got rid of it for some reason.
     
Thread Status:
Not open for further replies.

Share This Page