Ir para conteúdo
  • 0

Duvida


Wanderson Luis

Pergunta

Plugin

 

 

 

 

 

Estou fazendo meu primeiro plugin e estou com uma duvida. Eu estava tentando por mais de um comando em uma class isso e possivel ?

Onde eu posso começa com uma nova "If " pra adicionar outro comando?

Codigo:

 

 

 

 
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
 
public class Comandos implements CommandExecutor{
 
public boolean onCommand(CommandSender sender, Command cmd, String lb, String[] arg3) {
 
if (cmd.getName().equalsIgnoreCase("Efeito")){
Player p = (Player)sender; 
p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 20, 2));
}
return false;
}
 
}

 

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados


public boolean onCommand(CommandSender sender, Command cmd, String lb, String[] arg3) {

 

if (cmd.getName().equalsIgnoreCase("Efeito")){

Player p = (Player)sender;

p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 20, 2));

}

if (cmd.getName().equalsIgnoreCase("Efeito2")){

Player p = (Player)sender;

p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 20, 2));

}

return false;

}

Link para o comentário
Compartilhar em outros sites

public boolean onCommand(CommandSender sender, Command cmd, String lb, String[] arg3) {
 
if (cmd.getName().equalsIgnoreCase("Efeito")){
  Player p = (Player)sender; 
  p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 20, 2));
}
if (cmd.getName().equalsIgnoreCase("Efeito2")){
  Player p = (Player)sender;
  p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 20, 2));
}
return false;
}

Vlw <3

Link para o comentário
Compartilhar em outros sites

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