Ir para conteúdo
  • 0

[Duvida] Villager


kFlash_

Pergunta

2 respostass a esta questão

Posts Recomendados

Não sei muito mais vou tentar ajudar 

	public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
		Player p = (Player)sender;
		if (label.equalsIgnoreCase("mn")) {
			if (p.hasPermission("cmd")) {
				Villager v = (Villager)p.getWorld().spawnEntity(p.getLocation(), EntityType.VILLAGER);
				v.setCustomName("§5testre");
				v.setCustomNameVisible(true);
                v.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 9999999, 99999999));
				v.setProfession(Villager.Profession.LIBRARIAN);





	@EventHandler
	public void onNPCDamage(EntityDamageByEntityEvent e) {
		if (e.getEntity() instanceof Villager && e.getDamager() instanceof Player) {
			e.setCancelled(true);
		}
	}
Editado por Frogguer
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...