Player spoofing with online-mode

Player spoofing merely allows you to connect to a custom server under multiple player names using a single Mojang account. This requires the server you're connecting to to have online-mode set to true in its server.preferences file, so it is only useful on servers you control. This was documented fairly thoroughly in the 1.8 days but with later game versions and the new launcher (post 2016) some changes have been made.

I do not consider this piracy as this only works when running the game in offline mode. You still need to have a valid account to install and set up the game files, this workaround is purely for playing with friends every now and then on a self hosted server.

Server

Fortunately, the server side is really easy. In your server.properties you'll find online-mode=true. Set that to online-mode=false and you're ready to try spoofing player names.

Client

The client process is as follows:

  1. Install and launch the game normally to download all necessary files.

Pretty self-explanatory, but you'll need the game files and configs for this to work.

  1. Close launcher and edit account config.

After you've got all the necessary game and version files installed, close the game and launcher. In your .minecraft folder will be a file named launcher_accounts.json.

On Windows this is usually located in %APPDATA%\.minecraft. On Linux it's located in ~/.minecraft and in MacOS it's located in ~/Library/Application Support/minecraft.

Edit this file with your choice of text editor. We're looking for the "name" key, inside of the "minecraftProfile" block. You'll see something like this.

...
"minecraftProfile": {
    "id": "random_string_of_characters",
    "name": "Display_Name"
}
...

The current value will be your display name, edit this to whatever display name you want. Save this file, close whatever editor you're using and mark the file as read only. On Windows this can be accomplished in the file Properties > General > Attributes > Read-only. On Linux you can use chmod 0444 launcher_accounts.json and on MacOS the read-only attribute can be found in File Info (I don't have a Mac so I don't know the exact steps).

  1. Disconnect your internet and launch Minecraft

This is fairly important, we need to force Minecraft to run in offline mode.

If you have a better way to disable any inbound or outbound network connection to the Minecraft launcher you can use that, this is just convenient.

Make sure you disconnect the network before running the launcher else it will just prompt you to sign back in. Once you have started the game itself, you can turn your network back on.

  1. Connect to your custom server.

That's it! Just remember, when you want to play in online mode again you should set the launch_accounts.json file back to read/write from read-only.