mojang.api.base

mojang.api.base.get_blocked_servers() list[str]

Get a list of blocked servers hashes

mojang.api.base.get_profile(uuid: str) UnauthenticatedProfile | None

Returns the full profile of a user

Parameters:

uuid (str) – The uuid of the profile

Example:

>>> import mojang
>>> mojang.get_profile("069a79f444e94726a5befca90e38aaf5")
UnauthenticatedProfile(
    name='Notch',
    uuid='069a79f444e94726a5befca90e38aaf5',
    is_legacy=False,
    is_demo=False,
    skin=Skin(source='...', variant='classic'),
    cape=None
)
mojang.api.base.get_status() list[mojang.api.structures.ServiceStatus]

Get the status of Mojang’s services

Example:

>>> import mojang
>>> mojang.get_status()
[
    ServiceStatus(name='minecraft.net', status='green'),
    ServiceStatus(name='session.minecraft.net', status='green'),
    ServiceStatus(name='account.mojang.com', status='green'),
    ServiceStatus(name='authserver.mojang.com', status='green'),
    ServiceStatus(name='sessionserver.mojang.com', status='red'),
    ServiceStatus(name='api.mojang.com', status='green'),
    ServiceStatus(name='textures.minecraft.net', status='green'),
    ServiceStatus(name='mojang.com', status='green')
]
mojang.api.base.get_username(uuid: str) str | None

Get username for a uuid

Parameters:

str (uuid) – The uuid you want the username of

Example:

>>> import mojang
>>> mojang.get_username("069a79f444e94726a5befca90e38aaf5")
'Notch'
mojang.api.base.get_uuid(username: str) str | None

Get uuid for a username

Parameters:

username (str) – The username you want the uuid of

Example:

>>> import mojang
>>> mojang.get_uuid("Notch")
'069a79f444e94726a5befca90e38aaf5'
mojang.api.base.get_uuids(usernames: Iterable[str]) dict[str, str | None]

Get uuids for multiple usernames

Limited Endpoint

The Mojang API only allow 10 usernames maximum, if more than 10 usernames are given to the function, multiple request will be made.

Parameters:

usernames (list) – The usernames you want the uuid of

Example:

>>> import mojang
>>> mojang.get_uuids(["Notch", "_jeb"])
{
    'notch': '069a79f444e94726a5befca90e38aaf5',
    '_jeb': '45f50155c09f4fdcb5cee30af2ebd1f0'
}