001 package org.bukkit.command.defaults; 002 003 import org.bukkit.Bukkit; 004 import org.bukkit.ChatColor; 005 import org.bukkit.command.CommandSender; 006 007 public class TestForCommand extends VanillaCommand { 008 public TestForCommand() { 009 super("testfor"); 010 this.description = "Tests whether a specifed player is online"; 011 this.usageMessage = "/testfor <player>"; 012 this.setPermission("bukkit.command.testfor"); 013 } 014 015 @Override 016 public boolean execute(CommandSender sender, String currentAlias, String[] args) { 017 if (!testPermission(sender)) return true; 018 if (args.length < 1) { 019 sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage); 020 return false; 021 } 022 023 sender.sendMessage(ChatColor.RED + "/testfor is only usable by commandblocks with analog output."); 024 return true; 025 } 026 }