Hello I'm just start coding Java and i need help. I try to make command /lobby that will teleport you. But it's don't work. I have problem that it teleport on coordinates, but not in the world "Lobby". If you know please help! Code: public String com1 = "lobby"; @Override public boolean onCommand(CommandSender sender,Command cmd,String label,String[] args) { if(sender instanceof Player) { if(cmd.getName().equalsIgnoreCase(com1)) { if(sender.hasPermission("lobby.use")) { Player p = (Player) sender; sender.sendMessage(ChatColor.BLUE + "You teleported in lobby!"); Location loc = p.getLocation(); World lobby = loc.getWorld(); loc.setWorld(loc.setWorld("Lobby"); loc.setX(24.9966); loc.setY(136.0); loc.setZ(-15.0075); loc.setYaw(0); loc.setPitch(0); p.teleport(loc); return true; } else { sender.sendMessage(ChatColor.RED + "You don't have permission to use that command!"); } } } else { sender.sendMessage(ChatColor.RED + "Just players can use this command!"); } return false; }
@Daniyil loc.setWorld(loc.setWorld("Lobby"); Why do you have a double call? And why not do new Location(world,x,y,z) ?