A few questions.... How can you store data so that it doesn't delete when the server shuts down? And how can you read in from the keyboard? Do you use a regular scanner or what?
This is not the place for questions, you're looking for Plugin Development. It will save you some time in the future. But to save you some trouble... There are many ways to store data to disk but perhaps the easiest was is with Java's ObjectInputStream and load with ObjectInputStream. However, storing objects will make anything saved illegible. If you want to make the data available to the user in the file you store it to it might just be best to use bukkit's FileConfiguration. I made a tutorial on this matter for people who are looking to get the basics down. Good Luck
When a player types in something: ie: /s georgia 5 I understand how to read the command /s but how can i read in the georgia and the 5
args[] ... onCommand(CommandSender sender, Command cmd, String label, String[] args) @sender the one who send the command @CMD command passed @Label the typed command @args the arguments after the command args[0] as the first argument /<label> <args...>
u only need to save the /<command> on your plugin.yml example a player typed /tp me player2 then on your onCommand use if(label.equalsIgnoreCase("tp")) right? then after that do if(args.length==2){ if(args[0].equalsIgnoreCase("me")){ (Player) sender.teleport((Player) args[1].location) } } that means if the number of strings after the typed command(in here, after /tp) is equals to 2...then the command sender will be teleported to player2 location args is the parameters you put after the command. on your example... args[0] = "georgia"; args[1] = "5";
With that method you would get an error because you cannt directll cast a string into a player instead you have to use this: Code: try { getServer().getPlayer(StringNameOfPlayerInHere) } catch (Exception ex) { cs.sendMessage("Invalid player"); }
i thought it was Integer.valueOf(args[1]) im not trying to make a workable code there...im just giving an example
lol...dude...it was just an example...and the question his asking is for only the parameters after the send command...xD...and nothing else