Interface MojangAPI
public interface MojangAPI
Fetch Minecraft data from Mojang's API.
We use internal data providers to speed up the process and avoid spamming Mojang's API.
You have the option to fetch data from mojang:
- Get UUID and SkinProperty by a premium player name
- SkinProperty by UUID
- UUID by premium player name
This will not use any local cache, but one of our data providers may remotely cache the result data.
-
Method Summary
Modifier and TypeMethodDescriptiongetProfile
(UUID uuid) Get skin property by player name, this method will return empty if the player is not premium.
-
Method Details
-
getSkin
Get skin property by player name, this method will return empty if the player is not premium. It may return a hardcoded skin value, for example for "Steve" or "Alex". It does, in theory, a name to uuid to profile request. But internally it is faster than callinggetUUID(String)
andgetProfile(UUID)
separately. That is because we use ashcon.app, and we can directly get the profile and uuid from the name.- Parameters:
playerName
- Premium player username- Returns:
- Skin or empty if the player is not premium
- Throws:
DataRequestException
- If there was an error while getting the data
-
getUUID
- Throws:
DataRequestException
-
getProfile
- Throws:
DataRequestException
-