Teleport All Command
Posted: Thu Jun 21, 2012 7:19 pm
Anyone know why this does not want to work? The YML is setup fine.
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { Player player = (Player)sender; if (commandLabel.equalsIgnoreCase("startgame")) { Location location = new Location(Bukkit.getWorld("world"), -31, 69, 7); Player [] players = getServer().getOnlinePlayers(); for (int count = 0; count < players.length; count++){ Player currentPlayer = players[count]; currentPlayer.teleport(location); } return true; } if (commandLabel.equalsIgnoreCase("endgame")) { Location location = new Location(Bukkit.getWorld("world"), 0, 65, 0); Player [] players = getServer().getOnlinePlayers(); for (int count = 0; count < players.length; count++){ Player currentPlayer = players[count]; currentPlayer.teleport(location); } return true; } return false; }