Command I wrote a LONG time ago. Pretty sure it could be done better but whatever. Figured someone could put this to use.
imports
Code:
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
command
Code:
if (playerCommand.startsWith("suggest")
&& playerCommand.length() > 7) {
try {
BufferedWriter suggestion = new BufferedWriter(new FileWriter(
"./Data/Suggestions/suggestions.txt", true));
String Suggestion = playerCommand.substring(7);
try {
suggestion.newLine();
suggestion.write(c.playerName + ": " + Suggestion);
c.sendMessage("You have successfully submitted your suggestion, Thanks.");
} finally {
suggestion.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
Do what you wish. Keep the flame to yourselves as I personally do not care.