@DaanSander Are you requesting a plugin to be made or asking how to make one? If the latter, then here: 1) Iterate through all of the players. 2) Send each player (on iteration) to the location of the sender. These will help you: http://jd.bukkit.org/rb/doxygen/db/dc0/classorg_1_1bukkit_1_1Bukkit.html http://jd.bukkit.org/rb/doxygen/d5/d74/interfaceorg_1_1bukkit_1_1entity_1_1Player.html http://wiki.bukkit.org/Plugin_Tutorial
Code:java public voic tpAll(Player player) { for(Player online : Bukkit.getOnlinePlayer()) { if(player.getUniqueId().equals(online.getUniqueId())) { continue; } online.teleport(player); }}
@MaTaMoR_ that wont work. Learn java. EDIT: Oops I didn't see the continue statement bit as I posted that on mobile..
It has the general idea (minus typos). Though I would teleport everyone in the world, not the server (as cross-world teleportation usually isn't a desired effect of a tpall command).
I'd do it like this: Code: public void tpAll(Player p) { for(Player all : Bukkit.getOnlinePlayers()) { if(all != p) { all.teleport(p); } else { return; } }
That's your best bet. Is it an actual error or warning? Eclipse likes to be precise EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Method ambiguity is a compile-time error. Additionally your code example is filled with bad formatting and logic errors
Code:java @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){ if(cmd.getName().equalsIgnoreCase("tpall")){ if(sender instanceof Player){ Player p = (Player) sender; for(Player o : Bukkit.getOnlinePlayers()){ if(o != p){ if(o.getLocation().getWorld() == p.getLocation().getWorld()){ o.teleport(p); } } } } } return false; }