this in other classes

Discussion in 'Plugin Development' started by albin900, Jan 12, 2014.

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

    albin900

    Hello i'm making a plugin that get the current online players and i recently moved the file to another class. When i did that the
    Code:java
    1.  
    2. this.getServer().getOnlinePlayers().length;
    3.  

    got red and says "The method getServer() is undefined for the type Run" (Run is the class name).
    How do i define "this" in other classes that main class?
     
  2. Offline

    felixfritz

    The method "getServer" only comes with the JavaPlugin class. You can use Bukkit.getOnlinePlayers() instead.
     
  3. Offline

    albin900

    Thanks alot!
     
Thread Status:
Not open for further replies.

Share This Page