creating a command that deletes a line from a text file

Discussion in 'Plugin Development' started by dkbug, Jun 2, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    Hello, I really need to know how to delete a line from a text file, say "banned-players.txt". I have created a text file with
    new File("plugins" + File.separator + "Shakaban" + File.separator + "banned-players.txt"
    to make a plugin that will ban people with /ban <player_name>.
    I have already got the banning part of it to work just fine, but I need help with the unbanning.
    any ideas/suggestions?
  2. Offline


    What I did for something similar in a .yml setup was I found what I wanted to delete, then I made it equal null - but in your case you can make it equal "" or something along those lines to achieve the desired effect.
  3. Offline


    Thanks just what I needed, when I get back to my desktop I will make this solved.
Thread Status:
Not open for further replies.

Share This Page