Você quer que fique com poção infinita até digitar o comando
/visivel?
Se sim:
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player p = (Player)sender;
if (sender instanceof Player) {
if (label.equalsIgnoreCase("invisivel")) {
if (p.hasPermission("invisivel")) {
p.sendMessage("§aVoce ta invisivel!");
p.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 9287387, 1));
} else {
p.sendMessage("§cSem permissão");
return true;
}
}
if (label.equalsIgnoreCase("visivel")) {
if (p.hasPermission("visivel")) {
p.sendMessage("§aVoce ta visivel!");
p.removePotionEffect(PotionEffectType.INVISIBILITY);
} else {
p.sendMessage("§cSem permissão");
return true;
}
}
}
return false;
}