Get Player client version?

Discussion in 'Spigot Plugin Development' started by LookPvP, Jun 18, 2015.

  1. Hey there! I want to know if is possible to get what version the player is using. Like, I am using spigot to both versions and I want to know if this is possible. (I also use ProtocolLib if this helps)
     
  2. A quick goole search gave me this answer
    Code (Text):
    ((CraftPlayer) player).getHandle().playerConnection.networkManager.getVersion();
    **Not Tested**
     
    • Like Like x 1
  3. GOole? Lol
     
    • Funny Funny x 1
    • Optimistic Optimistic x 1
  4. I haven't tested it either, but I think Bimmr is right - check the docs for confirmation. Even if this isn't the right method, it must be possible because server and clients are aware of eachother's versions (to stop incompatible versions from connecting)
     
    • Friendly Friendly x 1
  5. Code (Text):
    ProtocolLibrary.getProtocolManager().getProtocolVersion(player);
     
  6. Thank you! I just googled it like a thousand times but I didn't see anything, then yesterday I saw a post on Bukkit saying that this thing is impossibl. After that I decided to try here and yes.