@API(status = STABLE)
public final class SkinUtilUtilities for fetching the skin (and cape) of a Minecraft account using Mojang's session servers.
Methods
Skin fetchSkin(MinecraftAccount)Fetches the skin currently used by the given account.Skin fetchSkin(UUID)Fetches the skin currently used by the player with the given UUIDSkin fetchSkin(String)Fetches the skin currently used by the player with the given UUIDSkinModel getDefaultModel(MinecraftAccount)SkinModel getDefaultModel(UUID)public static Skin fetchSkin(MinecraftAccount account) throws IOException, HttpExceptionFetches the skin currently used by the given account.
| Parameters | ||
|---|---|---|
account | MinecraftAccount | The account to look up |
| Returns | ||
Skin | The player's Skin, or null if the account has no skin set | |
| Throws | ||
IOException | If the request could not be made | |
HttpException | If the session server responded with an error | |
fetchSkin(UUID)
staticSource
public static Skin fetchSkin(UUID uuid) throws IOException, HttpExceptionFetches the skin currently used by the player with the given UUID
| Parameters | ||
|---|---|---|
uuid | UUID | The player's UUID |
| Returns | ||
Skin | The resolved Skin, or null if the account has no skin set | |
| Throws | ||
IOException | If the request could not be made | |
HttpException | If the session server responded with an error | |
fetchSkin(String)
staticSource
public static Skin fetchSkin(String uuid) throws IOException, HttpExceptionFetches the skin currently used by the player with the given UUID
| Parameters | ||
|---|---|---|
uuid | String | The player's UUID (can be dashed or undashed) |
| Returns | ||
Skin | The resolved Skin, or null if the account has no skin set,
no matching profile was found, or the profile carries no readable texture data | |
| Throws | ||
IOException | If the request could not be made | |
HttpException | If the session server responded with an error | |
public static SkinModel getDefaultModel(MinecraftAccount account)| Parameters | ||
|---|---|---|
account | MinecraftAccount | The account to fetch the default model for |
| Returns | ||
SkinModel | The SkinModel Minecraft would assign the account by default
(if it never set a skin), based on its UUID | |
public static SkinModel getDefaultModel(UUID uuid)