# Usage

# Get authlib-injector

First you need to download the latest version of authlib-injector from here (opens new window).

# Original server / Spigot / Paper / ...

Since authlib-injector v1.2.0, enforce-secure-profile needs to be set to true, unlike previous versions!

If you are having issues with chat message signatures on MC 1.19+, please read: ๐Ÿ‘‰ authlib-injector v1.2.0 upgrade FAQ FAQ #174 (opens new window) ๐Ÿ‘ˆ

Please set the online-mode in the server server.properties to true. For 1.19+ servers, you also need to set enforce-secure-profile to true**.

Then add the following JVM parameters to the server's startup command (the added parameters are located before -jar **):

-javaagent:{path/to/authlib-injector.jar}={https://your-yggdrasil-api-root.com}
  • {path/to/authlib-injector.jar} indicates the location of the JAR file you downloaded in previous step (both relative path and absolute path are available).
  • {https://your-yggdrasil-api-root.com} represents the URL of the authentication server.

For example, this is the original startup command:

java -jar minecraft_server.1.12.2.jar nogui

Suppose:

  • The authlib-injector JAR file you downloaded is called authlib-injector.jar.
  • You put it in the same directory as the server JAR minecraft_server.1.12.2.jar.
  • The URL of the authentication server is https://example.yggdrasil.yushi.moe.

Then the command line after adding the parameters should be as follows:

java -javaagent:authlib-injector.jar=https://example.yggdrasil.yushi.moe -jar minecraft_server.1.12.2.jar nogui

# BungeeCord / Velocity

If using BungeeCord or Velocity, then on all servers** and BungeeCord / Velocity** you need to load authlib-injector (see above) and enable enforce-secure-chat. But only BungeeCord / Velocity should enable online-mode, and the backend MC server should disable online-mode.

# Calling the Mojang skin

After loading authlib-injector, all skins are fetched from the specified authentication server by default. E.g:

  • /give @p minecraft:skull 1 3 {SkullOwner:"notch"}
  • (Citizens2 plugin) /npc skin notch

These commands get the skin of the character named notch on the custom authentication server.

If you want to use Mojang's skin, you can add @mojang after the character name, like:

  • /give @p minecraft:skull 1 3 {SkullOwner:"notch@mojang"}
  • /npc skin notch@mojang

For details, see the -Dauthlibinjector.mojangNamespace option in README ยง Parameters (opens new window).

# Access Mojang through a proxy

Calling the function of Mojang skin requires the MC server to be able to access the Mojang API. If your server needs to access Mojang through a proxy, then you can specify the proxy by adding the following JVM parameters at startup:

-Dauthlibinjector.mojangProxy=socks://<host>:<port>

Notice:

  • This proxy will only be used when querying Mojang for character information, material image downloads will not go through the proxy (even materials from Mojang).
  • Currently only SOCKS5 is supported.