Original UUID on ofline-mode

Discussion in 'Spigot Plugin Development' started by SobkySK, Aug 16, 2018.

  1. Hello, is there possible to have original UUID of player, who has purchased Minecraft, when the server is on online-mode: false?

    What plugins do I need?
    Can you explain me that?

    Thanks a lot :)
  2. ScarabCoder

    ScarabCoder Retired Resource Staff

    You can get a UUID from a username, but that means an offline mode player using a premium player username will give a premium UUID. If you want to find out if it's an offline mode player, you will have to slightly modify how the server operates. Patching NMS or CraftBukkit would work well, or you can attempt to use ProtocolLibrary and send certain packets at the right time.

    See: https://pastebin.com/HTUSAxbK
    Also: https://www.spigotmc.org/threads/verify-if-player-is-premium.334664/#post-3119820

    It's not worth the trouble. Nor is using an offline mode network. You will have issues with the players that will pollute your playerbase, and from an ethical standpoint you're supporting users who are using an illegally stolen version of Minecraft.
  3. I totally agree and I don't understand why spigot gives an online mode false option
  4. ScarabCoder

    ScarabCoder Retired Resource Staff

    I use it for testing purposes, since I can test with 3+ accounts without having to get other people online.
    Or maybe if your server actually is offline and for some reason isn't able to contact Mojang servers.
  5. I consider that it has a lot of troubles. But I had online-mode: true since last year and too little players was on the server. So I want to try this option.

    Yes, I agree too, but in my country isn't many players who own original :( :(
  6. Sure. Simple. Quick.

    Do a HTTP GET request to https://api.mojang.com/users/profiles/minecraft/<username>?at=<timestamp> (while timestamp is optional).
    Also see https://wiki.vg/Mojang_API#Username_-.3E_UUID_at_time.

    The result will tell you the real online-mode premium-user UUID of the given name (or HTTP 204 if it doesn't exist).
    But be aware, it's not sure, that the actual player on your server is the owner of this name (because your server is in offline mode).

    If you want to check, if a player on a offline-mode server is actually the real owner of the premium-user online-mode account, you'll have to check its session, which can (proofed working) be done like described in following threads: