Getting Clients Version When A Player Joins

Discussion in 'Spigot Plugin Development' started by _xXProDudeXx_, Apr 13, 2017.

  1. Hello Spigotiers,

    The title says it all I think. I am trying to find a way without any use of API's or Libraries to get the version of the client of a player when he joins the server. I have tried this with the PlayerConnection class but I didn't find a good way.

    Anyone to help me?
  2. FrostedSnowman

    Resource Staff

  3. Than i would check spigot's source for that method, and try it myself.
    • Funny Funny x 1
  4. @GoRoK well I didn't manage to find it .....
    @FrostedSnowman there is nothing wrong with using ProtocolLib, just I want to achieve this without use of any API's or Libraries
  5. Well, a trick.
    If the server has the plugin ViaVersion then hook with it, if not, it means that the player version is the same as the server one, or.. no?

    Pretty hacky tho
  6. @crazyhoorse961 the thing is that I want to give backwards support in a server with server jar 1.11. I want to check the client version and then send these players the correct version of a packet to the player.
  7. The only way I know off is replacing the networkinitializer like viaversion does and intercepting incoming packets
  8. I would be interested to know,
    you may want to hook with ViaVersion or ProtocolSupport as that's basically allowing any* version to connect.

    * depends on settings