Entities Not Spawning

Discussion in 'Plugin Development' started by 1Camer0471, Feb 1, 2016.

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

    1Camer0471

    Hello, I am trying to make a mini game, but when I try to spawn in any monsters, they dont appear, I think this is because I am spawning them in a world right after teleporting players to it. They are all in the same chunk so that shouldn't be the issue.

    the constructor for the zombie, I spawn them by creating a new CSZombie(...);

    Code:JAVA
    1.  
    2. public CSZombie(int round, Location loc, CSMain main) {
    3. Zombie zomb = (Zombie) CSMain.gameWorld.spawn(loc, Zombie.class);
    4. for (LivingEntity v : loc.getWorld().getEntitiesByClass(Villager.class)) {
    5. if (v.getCustomName().equalsIgnoreCase(
    6. main.getConfig().getString("KingName"))) {
    7. zomb.setTarget(v);
    8. break;
    9. }
    10. }
    11. zomb.setCustomName(ChatColor.GRAY + "[" + ChatColor.RED + ""
    12. + ChatColor.BOLD + "ZOMBIE" + ChatColor.GRAY + "] "
    13. + ChatColor.GREEN + "Level: " + round);
    14. zomb.setCustomNameVisible(true);
    15. zomb.setBaby(false);
    16.  
    17. zomb.setMaxHealth((double) round * 5);
    18. zomb.getEquipment().setHelmet(new ItemStack(Material.CHAINMAIL_HELMET));
    19. zomb.getEquipment().setItemInHand(new ItemStack(Material.WOOD_SWORD));
    20. z = zomb;
    21. }
    22.  
    23.  
     
  2. Offline

    JTGaming2012

    Can't really see any issues in the code. Have you checked that the method is actually firing?
     
Thread Status:
Not open for further replies.

Share This Page