Putting an animal into "Breeding mode"

Discussion in 'Plugin Development' started by bobacadodl, Dec 15, 2012.

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

    Shiny Quagsire

    What about the villager heart particles? I believe those ones are shown to all players.
     
  2. Offline

    fireblast709

    Packet38EntityStatus
     
  3. Offline

    bobacadodl

    Yep. When I right click on animals with wheat, the hearts appear.

    :(

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

    ZeusAllMighty11

    Here is what awjeifopawef does.


    Code:
     
                    CraftOcelot ocelot = (CraftOcelot)player.getWorld().spawn(player.getLocation(), Ocelot.class);
     
                    player.getHandle().world.broadcastEntityEffect(ocelot.getHandle(), (byte)7);
     
                    ocelot.remove();
     
    

    They basically spawn an ocelot and then force hearts on it, but make the ocelot not visible
     
    nate0927 likes this.
  5. Offline

    bobacadodl

    I already knew about this, but the hearts don't follow the mob around. It will have to do for now though. If anyone figures out why the hearts aren't showing up when I put the mobs into breeding mode, please let me know!
     
  6. Offline

    fireblast709

    bobacadodl the reason you cannot see them, is that you don't feed them yourself. They are sent to the player that feeds them, and that is probably not set.
     
  7. Offline

    bobacadodl

    Yeah I read that reply. Is there any way to set which player fed them?..
     
  8. Offline

    Drkmaster83

    I'm sure there is if you were able to detect a PlayerDropItemEvent and check if that item is wheat... if it is, store it in a HashMap, and when the Cow eats it, check if it's in the HashMap with the string of the player's name -- Or something along those lines, hopefully.
     
  9. Offline

    bobacadodl

    .............
    I know how to do this but how do I actually SET the player and display the heart effect to them??
     
  10. Offline

    ZeusAllMighty11

    My code above works fine for me
     
  11. Offline

    bobacadodl

    It doesn't follow the mob around when it moves.
    I'm using that code ATM but I'm trying to get a better solution
     
  12. Offline

    fireblast709

    Schedule a task spawning the hearts?
     
  13. Try sending the player the heart packets and make sure you have your particles on :D
     
  14. Offline

    fireblast709

    Or just schedule a task, and inside there:
    • spawn an ocelot/wolf
    • spawn hearts
    • despawn
     
  15. Yes you can do this too ;3
     
  16. Offline

    fireblast709

    Why messing with packets if minecraft does this for you? :p
     
  17. I agree :3
     
  18. Offline

    bobacadodl

    I've already said a million times that these heart particles don't follow the mob around -.- but its good enough i guess.
     
  19. Offline

    fireblast709

    bobacadodl when you update the location, it will at least look like the hearts are following the animal
     
  20. Offline

    chasechocolate

    bobacadodl This might be possible with the addParticle method, although I am not 100% sure, and I haven't tested it:
    Code:java
    1. world.addParticle("heart", x, y, z, <random double between -1 and 1>, <random double between -1 and 9>, <random double between -1 and 1>);

    For a full list of particles, see http://www.minecraftwiki.net/wiki/Particles
     
  21. Offline

    fireblast709

    Won't work as somehow the actual implementation of the method is empty
     
  22. Offline

    chasechocolate

    Hmmm... that's weird...
     
Thread Status:
Not open for further replies.

Share This Page