My warn plugin

Discussion in 'Plugin Development' started by Laxer21117, Feb 19, 2015.

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


    Hi guys. I have a warn plugin and I want to be able to type ./wcheck <player> and it will tell me how many warns they have. I have it so when they are warned it adds their names to a file so how do I get the # of warns from the file to show up when they type the command in-game?
  2. Offline


    int numberofwarns = config.getInt("string.path");
  3. Offline


    If it writes a number if warns then do what @Arrays said. If you simply write the names, then you will need to loop through all contents of file or list in config (depends on how you store them) and count how many times a players name apears. (Dont do this in 'onCommand' method, it's inefficient)
    Find more help on documentations and specifically YamlConfiguration and superclasses...
Thread Status:
Not open for further replies.

Share This Page