Online data from an offline player

Discussion in 'Plugin Development' started by Staartvin, Nov 30, 2012.

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

    Staartvin

    Hi there,

    I was wondering:
    Is there a way to get the 'online data' from an offline player.
    I want data just when you call '.getPlayer(playerName)'.
    With the exception of the current world, current position, etc. That's not possible because a player is not online.

    Any ideas?
     
  2. Offline

    Staartvin

    Inventory for example.
    I know that you can save the inventory on PlayerQuitEvent, but I would like to know if there's another way.
     
  3. Offline

    fireblast709

    Bukkit.getOfflinePlayer(playername). Note that this method will always return a player (even if the account would not exist)
    [addition] you cannot get an inventory from an OfflinePlayer
     
  4. Staartvin The problem is that the players inventory isn't there (it's stored on disc and unloaded from RAM) when the player is offline. You could open the players file and read out the needed info, but that's some work...
     
  5. I found this in the resource forum... Seems to have that function. You could also look in the code of OpenInv maybe.
     
  6. Offline

    Staartvin

    Ok, I'm just going to look into reading the players file then.
     
Thread Status:
Not open for further replies.

Share This Page