1.12.2 Check if player has OptiFine

Discussion in 'Spigot Plugin Development' started by TaskID, Aug 13, 2020.

  1. Hello,

    is there any option to check if a player has optifine?

    If not on spigot, on bungeecord would be fine too.
  2. MC|Brand or `Received on channel: minecraft:brand` .. all depends on how versions progress.

    you can run a plugin that spits out the channel info, by detecting if the packages sent by the client are one thing or another.

    If any of that in 1.16.2 is still valid for optifine etc, i honestly dont know.
  3. Ok thank you, but I never really worked with that. How do I check that? Do you have any examples or javadocs for me?
  4. I think you can register an incoming plugin message channel for "minecraft:brand" like with BungeeCord plugin messaging channel and use a PluginMessageListener.

    Then you can convert the byte-array data into a String and get the client version out of it.

    If this does not work, you have to intercept the PluginMessage packet and get the brand name from there (with ProtocolLib for example).
    • Informative Informative x 1
  5. Not going to work since optifine does not change the brand name for some reason.
    I've already opened a issue 2 years ago on their github (tested with 1.12.x - 1.15.x).
    A client with only optifine installed will still send "vanilla" and not "optifine" when connecting to a server.
    • Informative Informative x 4
    • Agree Agree x 1