MojangApiParser

Utility object for interacting with Mojang's public profile API.

Provides helper functions to:

  • Resolve a Minecraft username → UUID

  • Resolve a UUID → username/profile

  • Check the availability of Mojang API endpoints

All API calls are performed synchronously using OkHttp and return null or false on failure instead of throwing.

Functions

Link copied to clipboard
fun getUsername(uuid: UUID): ERROR CLASS: Cannot infer argument for type parameter R

Fetches the Mojang profile associated with the given UUID.

Link copied to clipboard
fun getUuid(name: String): ERROR CLASS: Cannot infer argument for type parameter R

Fetches the Mojang profile associated with the given Minecraft username.

Link copied to clipboard

Verifies whether Mojang's username → UUID API endpoint is reachable.

Link copied to clipboard

Verifies whether Mojang's UUID → profile API endpoint is reachable.