Skip to content

Instantly share code, notes, and snippets.

@heinrichquirit
Created August 25, 2013 04:27
Show Gist options
  • Save heinrichquirit/6332002 to your computer and use it in GitHub Desktop.
Save heinrichquirit/6332002 to your computer and use it in GitHub Desktop.
public boolean onCommand(CommandSender sender, Command cmdObj, String lbl, String[] args) {
if (!(sender instanceof Player)) {
if (cmdObj.getName().equalsIgnoreCase("freeze")) {
if (args.length == 1) {
Player p = Bukkit.getPlayer(args[0]);
if (p != null) {
if (!p.hasPermission("freeze.immune") || p.hasPermission("freeze.immune")) {
sender.sendMessage("Froze " + p.getName() + " even his immune.");
}
}
}
}
} else {
if (cmdObj.getName().equalsIgnoreCase("freeze")) {
if (args.length == 1) {
Player p = Bukkit.getPlayer(args[0]);
if (p != null) {
if (!p.hasPermission("freeze.immune")) {
sender.sendMessage("Froze " + p.getName());
} else {
sender.sendMessage(p.getName() + " is immune to this command.");
}
}
}
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment