Moyang Or Mojang

broken image


  • 2API Status
  • 3Username -> UUID at time
  • 4UUID -> Name history
  • 5Playernames -> UUIDs
  • 6UUID -> Profile + Skin/Cape
  • 7Change Name
  • 8Change Skin
  • 9Upload Skin
  • 10Reset Skin
  • 11Security question-answer flow
  • 12Blocked Servers
  • 13Statistics
  1. How Do You Pronounce Mojang
  2. Minecraft Sign In With Username
  3. Mojang Suggestion
  4. Mojang Or Mojang Server

Moyang translation in Malay-English dictionary. Ms 2 Oleh kerana itu, marilah kita pergi; marilah kita kuat seperti Musa; kerana dia benar-benar berbicara kepada perairan Laut Merah dan ia membahagi ke sini dan ke sana, dan nenek moyang kita telah melintasinya, keluar dari tawanan, di atas tanah kering, dan tentera-tentera Firaun telah ikut dan telah lemas di dalam perairan Laut Merah.

  • (Mojang are the people who made Minecraft) It the name 'Mojang' pronounced 'Moe-yang' or 'Moe-jang'?
  • Just consider this: a programmer who recently joined Mojang Studios learned to code using Minecraft, and is now helping us inspire a new generation of players, creators, and developers. That's an ecosystem of play we couldn't have imagined over a decade ago.
  • In this video, I beat Minecraft using official Mojang guides. Do the creators of the game know something we don't? Aaahhhh yes we love moyang.

Notes

  • All public APIs are rate limited so you are expected to cache the results. This is currently set at 600 requests per 10 minutes but this may change.
  • For some parts of the API, demo accounts are sometimes included, sometimes not. Mojang keeps changing this.
Support

API Status

Returns status of various Mojang services. Possible values are green (no issues), yellow (some issues), red (service unavailable).

Response

Username -> UUID at time

This will return the UUID of the name at the timestamp provided.

?at=0 can be used to get the UUID of the original user of that username, however, it only works if the name was changed at least once, or if the account is legacy.

  • The timestamp is a UNIX timestamp (without milliseconds)
  • When the at parameter is not sent, the current time is used

Since November 2020, Mojang stopped supporting the timestamp parameter. If a timestamp is provided, it is silently ignored and the current uuid is returned. Please remind them to fix this here: WEB-3367

Response

  • id is the uuid
  • name is the current name of that uuid, it is not the name requested!
  • legacy only appears when true (not migrated to mojang account)
  • demo only appears when true (account unpaid)

If there is no player with the given username an HTTP status code 204 (No Content) is sent without any HTTP body.
If the timestamp is not a number, too big or too small the HTTP status code 400 (Bad Request) is sent with an error message looking like this:

UUID -> Name history

Returns all the usernames this user has used in the past and the one they are using currently. The UUID must be given without hyphens.

Response

The changedToAt field is a Java timestamp in milliseconds.

Playernames -> UUIDs

This will return player UUIDs and some extras.

Payload

Response

  • name is case-corrected
  • legacy only appears when true (profile not migrated to mojang.com)
  • demo only appears when true (account unpaid)
  • BadRequestException is returned when any of the usernames is null or otherwise invalid
  • The Content-Type HTTP header must be application/json
  • You cannot request more than 10 names per request

UUID -> Profile + Skin/Cape

This will return the player's username plus any additional information about them (e.g. skins). Example: https://sessionserver.mojang.com/session/minecraft/profile/4566e69fc90748ee8d71d7ba5aa00d20

This has a much stricter rate limit: You can request the same profile once per minute, however you can send as many unique requests as you like.

Response


  • 'legacy': true will appear in the response if the user has not migrated their minecraft.net account to mojang.

The 'value' base64 string for the 'textures' object decoded:

  • The timestamp is sometimes in the past (probably due to cached results?)
  • The 'SKIN' object will have 'metadata': {'model': 'slim'} if the player model has slim arms ('Alex?' style). For square arms ('Steve?' style), 'metadata' will be missing.
  • If no custom skin has been set, 'SKIN' will be missing.
    Whether the player has the 'Alex?' or 'Steve?' skin depends on the Java hashCode of their UUID. Steve is used for even hashes. Example implementations:
    • JavaScript (includes explanation)
    • Java (includes sample UUIDs)
  • Likewise 'CAPE' will be missing if the account has no cape.

Change Name

This will set the name for the account that the access token in the Authorization header belongs to.

Response

Upon error the server will send back a JSON with the error.

Status CodesResponses
400Name is invalid, longer than 16 characters or contains characters other than (a-zA-Z0-9_)
403Name is unavailable (Either taken or has not become available)
401Unauthorized (Bearer token expired or is not correct)
500Timed out (API lagged out and could not respond)
200Success (Name changed)

Headers

Payload

No payload needed.

Success Response


Change Skin

This will set the skin for the selected profile, but Mojang's servers will fetch the skin from a URL.

Response

Upon error the server will send back a JSON with the error. (Success is a blank payload)

Headers

Payload

The payload for this API consists of a JSON object containing the URL and variant

variant is either 'classic' or 'slim'


Example

Upload Skin

This uploads a skin to Mojang's servers. It also sets the users skin. This works on legacy counts as well.

Response

No response unless error

Headers

Payload

The payload for this API consists of multipart form data. There are two parts (order does not matter b/c of boundary):

varianteither 'classic' for normal model or 'slim' for slim model.
fileRaw image file data

Example

Reset Skin

Resets the user's skin to the default one.

Response

No response unless error

Headers

Example

Security question-answer flow

This is required to get the skin change endpoint to work in case the services do not trust your IP yet.

Check if security questions are needed

Good answer:

Bad answer:

Get list of questions

Answer:

The possible IDs are these:

Send back the answers

On failure, you will get some sort of error. Unless it's a syntax or json structure error, it will be this:

On success:

Blocked Servers

Returns a list of SHA1 hashes used to check server addresses against when the client tries to connect.

Clients check the lowercase name, using the ISO-8859-1 charset, against this list. They will also attempt to check subdomains, replacing each level with a *. Specifically, it splits based off of the . in the domain, goes through each section removing one at a time. For instance, for mc.example.com, it would try mc.example.com, *.example.com, and *.com. With IP addresses (verified by having 4 split sections, with each section being a valid integer between 0 and 255, inclusive) substitution starts from the end, so for 192.168.0.1, it would try 192.168.0.1, 192.168.0.*, 192.168.*, and 192.*.

This check is done by the bootstrap class in netty. The default netty class is overridden by one in the com.mojang:netty dependency loaded by the launcher. This allows it to affect any version that used netty (1.7+)

Response

How Do You Pronounce Mojang

A line separated list of all SHA1 hashes.

Some of the current ~2200 hashes have been cracked.

Statistics

Get statistics on the sales of Minecraft.

Payload

The payload is a json list of options under the metricKeys key.You will receive a single object corresponding to the sum of sales of the requested type(s).You must request at least one type of sale.Below is the default list used by https://minecraft.net/en/stats/

Valid options are:

Response

A json object is returned with the total amount of copies sold, the amount of copies sold in the last 24h and how many sales there are per second.

Examples

C# | full API wrapper

C# | full API wrapper with Mojang/Microsoft Authentication

Go | full API wrapper

Go | UUIDs or names to profiles with skins, capes and name histories

Python | Full API Wrapper. Also supports authentication & parts of the Minecraft website

Python | full API wrapper

Python | UUIDs or names to profiles

Python | names file to uuids+names file

PHP | Complete Mojang's API wrapper

Minecraft Sign In With Username

PHP | UUIDs or names to profiles with skins, heads and name histories

PHP | UUIDs to names

PHP | UUIDs to names, names to uuids

Mojang Suggestion

Java | Almost full API Wrapper

JavaScript | UUIDs or names to profiles with skins, capes and name histories

Mojang Or Mojang Server

Retrieved from 'https://wiki.vg/index.php?title=Mojang_API&oldid=16476'




broken image