MC Version

Discussion in 'Plugin Development' started by 97WaterPolo, Sep 17, 2014.

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

    97WaterPolo

    How would one get the version of MC a player is using? 1.7.2 vs 1.7.9, etc.
     
  2. Offline

    RawCode

    for what reason?
     
  3. Offline

    teej107

  4. teej107 He wants the version of the client, not the server. That's not something you'll find in the JavaDocs.
     
  5. 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.
     
  6. Offline

    CakePvP

    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:
    Code:java
    1. ((CraftPlayer)player).getHandle().playerConnection.networkManager.getVersion()

    Hope this helps :)
     
  7. Offline

    fireblast709

    Sadly enough not in CraftBukkit :p
     
  8. Offline

    97WaterPolo

  9. Offline

    fireblast709

    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)
     
    rbrick likes this.
Thread Status:
Not open for further replies.

Share This Page