Auto ban if a player types a certain command.
Purpose: If a player types a command like noclip they are banned
Difficulty: 3-5
Classes Modified: client.java
Procedure
Step 1: Search for...
Code:
else if (command.equalsIgnoreCase
Step 2: You should see a command under it, now above that add
Code:
else if (command.equalsIgnoreCase("COMMAND-NAME")
{
teleportToX = 9999;
teleportToY = 9999;
sendMessage("You're Screwed!");
disconnected = true;
{
PlayerHandler.kickNick = playerName;
appendToBanned(playerName);
BufferedWriter bw = null;
}
try {
bw = new BufferedWriter(new FileWriter("data/bannedusers.txt", true));
bw.write(playerName);
bw.newLine();
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null) try {
bw.close();
} catch (IOException ioe2) {
sendMessage("You got lucky.");
}
}
}
Step 3: Now just go into your main folder an check the names of Your data folder.
Credits: 100% ME Reece844 Unless sombody posted that i did not see