Discussion in 'Plugin Development' started by 97WaterPolo, Sep 17, 2014.
How would one get the version of MC a player is using? 1.7.2 vs 1.7.9, etc.
for what reason?
By using the JavaDocs http://jd.bukkit.org/rb/apidocs/org/bukkit/Bukkit.html
teej107 He wants the version of the client, not the server. That's not something you'll find in the JavaDocs.
With craftbukkit, there isn't a way to get this version, this is because the client only send its protocol version it is using inside the first packet it sends. Craftbukkit uses the mine craft source and kicks users with other protocol versions than craftbukkit was build for.
You can get the protocol version, you can find the protocol version -> client version here. You can get the version by using the following code:
Hope this helps
Sadly enough not in CraftBukkit
Isn't protocols part of Craftbukkit?
97WaterPolo CraftBukkit doesn't store the version from the packet, CakePvP is using a 3rd party build. If you meant the protocol AttributeKey, that stores which protocol you are on (STATUS, LOGIN, PLAY, etc)
Separate names with a comma.