Ever wanted to use your Minecraft skin as an avatar on forums, websites, or just about anywhere else you can use an <img> tag? Well now you can, thanks to Cravatar!

What is Cravatar?

Cravatar is a just a shortcut to an image of your current Minecraft avatar’s face. It’s a bit like Gravatar, but there’s no need for any configuration beyond setting up a custom skin on Minecraft.net (which you’ve probably already done).

How do I use it?

Using Cravatar is easy. Anywhere you can display an image via URL, you can display your Cravatar. The URL looks like this:


http://cravatar.tomheinan.com/<username>/<size>

In the form above, <username> is your Minecraft username (case sensitive!), and <size> is how big you want the image to be (in pixels). If you omit the <size> parameter, the image will default to 16px.

Examples

My Minecraft username is tomheinan, so my Cravatar URL is “http://cravatar.tomheinan.com/tomheinan”, which yields . That’s pretty tiny, though, so let’s say I wanted a version 64 square pixels in size. I just use:


http://cravatar.tomheinan.com/tomheinan/64

which gives me:

Easy! If you’d like to take a look at a more in-depth example, try the server status page. If anyone’s logged on, you’ll see their Cravatar next to their name.

FAQ

What if the user doesn’t have a custom skin set?

You’ll get the default skin, and the HTTP status code returned with the image will be 203 Non-Authoritative Information instead of the normal 200 OK.

What’s the range of sizes?

As small as 8px to as large as 256px, 16px by default.

What format is the image delivered in?

PNG.

I just updated my skin. Why hasn’t my Cravatar changed?

The script caches users’ skins locally, partly to avoid driving up Notch’s bandwidth bills and partly to deliver images as quickly as possible. The cache life is a few hours, so you may not see an immediate change, but your Cravatar will update itself soon.

Some other weird thing is going on!

Leave a comment below and I’ll try to help you out as best I can.

[message class=yellow-message ]Update27 Jan 2012 – The code’s now up on GitHub if you want to clone it and try it out on your own server![/message]

Comments

11 Comments

Post a comment
  1. October 11, 2011

    Great service! Thank you!

    Any chance you can fix it for players with underscores in their names?

    Also any chance you might do a full body front view also?

    • Tom #
      October 12, 2011

      I think I’ve fixed it for underscores, but I’ll need to give some thought as to how to do a front view that doesn’t look too weird. Thanks for the feedback!

  2. November 24, 2011

    Could you by any chance send me the code for this? I would love to host this on my own server, as I am setting up my own forum and would like to attempt to integrate it within phpbb.

    • Tom #
      November 25, 2011

      Sure, when I get back to my place in a few days I’ll put it up on GitHub and you can grab it from there :)

    • Tom #
      January 27, 2012

      Hey, sorry it’s taken me so long to get back to this, but I put the code up on GitHub; you can find it here.

  3. January 21, 2012

    I have the coding for a minecraft full body skin viewer. I hope it helps so contact me if you’d like that….i think it would take only some minor tweaking but doing so would give you major results (so it’s definitely recommended to try).

  4. December 1, 2012

    Uhmmm… I migrated to a mojang account and well, yeah, I can’t get a cravatar

    • Tom #
      December 1, 2012

      Just use your Minecraft username – I migrated my account too and it seems to work ok.

  5. Chen #
    May 24, 2013

    can you make an option to get the face without the hat layer? i have a hat layer on my skin and looks weired when its flat.

  6. June 12, 2013

    Are you going to push the nohat option to the github repo. Also, are you going to add an option for returning the skins full body? Because I would love to do it and share it on github, but i was gonna wait until you pushed a newer version to make my pull.

Leave a Reply