Ir para conteúdo
  • 0

[Resolvido] Como fasso para apenas spawnar um tipo de mob


Pergunta

9 respostass a esta questão

Posts Recomendados

Postado
Location l = new Location(location.getWorld(), x, location.getWorld().getHighestBlockYAt(location), z);
        location.getWorld().spawnCreature(1, CreatureType.CREEPER);

by bukkit

Postado

exemplo spawnar so zombie

Como não estou com o Eclipse aberto, vou dizer só como faz:

 

Utilize o evento CreatureSpawnEvent, depois verifique o tipo de entidade, caso não seja ZOMBIE, cancele o evento

Postado

exemplo spawnar so zombie

 

@EventHandler
public void onSpawn(EntitySpawnEvent event) {
        Entity entity = event.getEntity();
        if(entity.getType != EntityType.ZOMBIE && entity.getType != EntityType.PLAYER) {
                  event.setCancelled(true);
        }
}
Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...