How to spawn a baby entity?

Discussion in 'Plugin Development' started by callum2904, Feb 15, 2013.

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

    callum2904

    Currently i have this code
    Code:
        @EventHandler
        public void PigManKills(EntityDeathEvent event){
            Entity entity = event.getEntity();
            if (entity instanceof PigZombie){
                Player player = ((PigZombie) entity).getKiller();
                if(((PigZombie) entity).getKiller() instanceof Player){
                    Location location = entity.getLocation();
                    zombiedeaths ++;
                    player.sendMessage(ChatColor.GOLD +"Total Zombie Kills: " + ChatColor.DARK_RED + zombiedeaths + "");
                    Random object = new Random();
                    int randommob;
                    randommob = 1 + object.nextInt(50);
                    switch (randommob){
                    default:
                        entity.getWorld().spawnEntity(location, EntityType.ZOMBIE);
                    }
                   
                }
            }
        }
    so when you kill a pigzombie it will spawn a zombie. BUT! i was to change it so it dosent spawn a large zombie and it spawns a baby zombie!
     
  2. Offline

    Vandrake

    play around with the entity Object. If it was an Animal you could use .setBaby() or something xD
     
  3. Offline

    mb01

    Zombie also have a setBaby method.
    World.spawnEntity returns the entity, you can use that.
     
  4. Offline

    callum2904

    I have looked and messed around a bit and i still cant find out to. If someone doesn't mind can they paste a bit of coding here. i am wanting to spawn 4 baby zombies once a pigman is killed!

    thanks if you can help!

    any help?

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

    DJSanderrr

    Vandrake can i ask how you made that video? :$$
     
  6. Offline

    kreashenz

  7. Offline

    Vandrake

    I used Cinema4D and Sony Vegas :3
     
  8. Offline

    DJSanderrr

    Vandrake okay thanks ;D i going google it!

    I liked the vid btw
     
    Vandrake likes this.
  9. Offline

    chasechocolate

    Vandrake [Off-Topic] Cool video, well made!
     
    DJSanderrr and Vandrake like this.
  10. Offline

    DJSanderrr

    chasechocolate

    Bukkit also needs an off-topic thing like
    But then really [OFFTOPIC] off [/OFFTOPIC]
     
  11. Offline

    kreashenz

    DJSanderrr Chase cannot make one, contact a Bukkit page moderator/admin/owner.
     
  12. Offline

    DJSanderrr

    kreashenz
    Lol okay, How do i find contact with one of them? (And who is owner actuly? :$$$$$$$$$)
     
  13. Offline

    kreashenz

  14. Offline

    DJSanderrr

    kreashenz i also thought that, i'll try to make contact!
     
Thread Status:
Not open for further replies.

Share This Page