Skip to content

Client methods#

get_profile() #

Get information about the current profile.

Returns:

Type Description
Profile

A Profile object that contains information about a Minecraft profile

get_name_change_info() #

Check if the account's username can be changed.

Returns:

Type Description
Dict[str, Any]

A dictionary object that contains information about the account's username. Possible keys are changed_at, created_at, and name_change_allowed.

get_billing_info() #

Get general billing info and credit card information stored on the account.

is_username_available(username) #

Check if a username is available.

Limitations

A username must be between 3 and 16 characters and cannot contain invalid characters. If any of these constraints are broken, or if a username has already been taken by someone else, this function will return False.

Parameters:

Name Type Description Default
username str

The Minecraft username to check.

required

Returns:

Type Description
bool

True if the username is available; False if the username is invalid or already taken

is_username_blocked(username) #

Check if a username is blocked by Mojang's username filter.

Note

This function allows for the checking of usernames that have potentially been blocked. Blocking can happen either one of two ways - a username sniper has blocked the name for 24 hours on an empty Mojang account, or the username has been blocked by Mojang's inappropriate name filter for whatever reason. The reasons names are blocked aren't public, but this endpoint is the best way to check if a name is blocked.

Parameters:

Name Type Description Default
username str

The Minecraft username to check.

required

Returns:

Type Description
bool

True if the username is blocked; False if the username is not blocked

change_username(username) #

Change the profile's Minecraft username.

Limitations

You can only change your username once every 30 days. A username must be between 3 and 16 characters and cannot contain invalid characters.

Parameters:

Name Type Description Default
username str

The username you want to change to.

required

Returns:

Type Description
Dict[str, Any]

A dictionary object that contains information about whether the username was claimed. Possible keys are success (which contains True or False) and error with an error message (only if the function fails).

change_skin(variant='classic', url=None, image_path=None) #

Set a new skin for your profile.

Skin Requirements

Image dimensions have to be 64x32. The max allowed image size is 24576 bytes (24.576 KB). This function will raise a MojangError if the skin variant, or the provided image path or URL is invalid for some reason.

Parameters:

Name Type Description Default
variant Optional[str]

Set "slim" for the slim model, or "classic" for the default.

'classic'
url Optional[str]

A direct image URL to the skin you want to change to.

None
image_path Optional[str]

The file name or full file path to the skin image file.

None

Raises:

Type Description
MojangError

If the skin could not be changed for some reason.

copy_skin(username=None, uuid=None) #

Copy another player's Minecraft skin and skin variant. This will set their skin on your account.

Pass either the player's username or their UUID - not both.

Parameters:

Name Type Description Default
username Optional[str]

The username of the player whose skin you want to copy.

None
uuid Optional[str]

The UUID of the player whose skin you want to copy.

None

Raises:

Type Description
ValueError

If an invalid username or UUID is supplied.

change_skin_variant(variant) #

Change the skin variant for your current Minecraft skin.

Parameters:

Name Type Description Default
variant str

Set "slim" for the slim model, or "classic" for the default.

required

reset_skin() #

Reset the profile's Minecraft skin to the default one

disable_cape() #

Disable the profile's cape so it is no longer shown