classstableSource
@API(status = STABLE)
public final class SkinUtil

Utilities for fetching the skin (and cape) of a Minecraft account using Mojang's session servers.

Methods

public static Skin fetchSkin(MinecraftAccount account) throws IOException, HttpException
Fetches the skin currently used by the given account.
Parameters
accountMinecraftAccountThe account to look up
Returns
SkinThe player's Skin, or null if the account has no skin set
Throws
IOExceptionIf the request could not be made
HttpExceptionIf the session server responded with an error
public static Skin fetchSkin(UUID uuid) throws IOException, HttpException
Fetches the skin currently used by the player with the given UUID
Parameters
uuidUUIDThe player's UUID
Returns
SkinThe resolved Skin, or null if the account has no skin set
Throws
IOExceptionIf the request could not be made
HttpExceptionIf the session server responded with an error
public static Skin fetchSkin(String uuid) throws IOException, HttpException
Fetches the skin currently used by the player with the given UUID
Parameters
uuidStringThe player's UUID (can be dashed or undashed)
Returns
SkinThe 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
IOExceptionIf the request could not be made
HttpExceptionIf the session server responded with an error
public static SkinModel getDefaultModel(MinecraftAccount account)
Parameters
accountMinecraftAccountThe account to fetch the default model for
Returns
SkinModelThe SkinModel Minecraft would assign the account by default (if it never set a skin), based on its UUID
public static SkinModel getDefaultModel(UUID uuid)
Parameters
uuidUUIDThe UUID to fetch the default model for
Returns
SkinModelThe SkinModel Minecraft would assign that UUID by default (if it never set a skin)