mojang.api.models

class mojang.api.models.Cape(source: str, id: str | None = None, state: str | None = None, load: bool = True)

Bases: _Resource

Variables:
  • id (str) – The id of the cape

  • state (str) – The state of the cape

property id: str | None
property state: str | None
class mojang.api.models.Skin(source: str, variant: str, id: str | None = None, state: str | None = None, load: bool = True)

Bases: _Resource

Variables:
  • variant (str) – The variant of skin (default to ‘classic’)

  • id (str) – The id of the skin

  • state (str) – The state of the skin

property id: str | None
property state: str | None
property variant: str
class mojang.api.models._Resource(source: str, load: bool = True)

Bases: object

Base class for downloadable resources

Variables:
  • source (str) – The source where the skin is located

  • data (bytes) – Content of the resources in bytes

  • extension (str) – The type of file, if detected

property data: bytes
property extension: str | None
load()

Load data from the source

save(dest: str, add_extension: bool = True)

Save resource in a file

property source: str