Zombie's spawning with items and armour

Discussion in 'Spigot Plugin Development' started by xCorymbus, Aug 31, 2015.

  1. I am currently spawning a zombie, setting it to invisible and setting a player skull. Is there to make it so the spawned zombie has no chance of spawning with items (EG They sometimes spawn with a spade) and with no armour ?
     
  2. You can just do an if check to see if the zombie is wearing each piece of armor, and if so, remove it (if that's possible).
     
    • Like Like x 2
  3. Make a custom zombie class. But actually, do they spawn with random armor if you use spawnEntity(loc, EntityType.ZOMBIE)?
     
    • Like Like x 1
  4. Yes, During testing I found zombies spawned with golden armour and spades etc sometimes
    I will try that now, Thanks :D
     
  5. Then try to do it via nms code. ((CraftWorld)world).getHandle ().addEntity (EntityZombieInstance);
    EntityZombieInstance.setLocation....

    Something like that. Can't look it up now but works for my custom zombies that afaik don't over write any methods that could Cause them to get random armor.
     
  6. I believe there's a zombie.getEquipment() method. Simply clear the zombies equipment on spawn.
     
    • Informative Informative x 1
  7. You're right.