Question on the Server.getPlayer(...) methods

  • @red51 am I understanding correctly that the Server.getPlayer(int Playerid) and Server.getPlayer(String Playername) only work for currently online players but the Server.getPlayer(int PlayerUID) method will return the player object even for currently offline players?


    just asking because the Server.getPlayer(int PlayerUID) has no comment on the player online/offline state in the javadoc while the player object is defined as only for online players :/

  • Basically the getPlayer() methods only work for online players, I will update the javadoc soon ;) Right now it's not possible to get a "Player" object from an offline player. Only exception: if a player disconnects, but you still keep a reference to his "Player" object (although you can't do much with this reference, since most methods no longer work then).


    Currently the only way to get information of an offline player is to query the world database directly... but we definitely need a better solution for that!

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!