Minecraft

Identicraft

A lightweight Minecraft avatar rendering library, CLI, and serverless API. Open-source and you can try it yourself using your own deployment on Vercel.

Identicraft

Minecraft avatar rendering library, CLI, and serverless API. The API calling that uses identicraft.js.org is a demo-only. Consider using your own deployment for your production.

2D Avatar (Simple)

Returns a 2D front-facing avatar head. You can use either a Minecraft username or UUID.

https://identicraft.js.org/avatar/{username_or_uuid}/{size}.png
avatar render

3D Avatar (Isometric)

Returns a 3D isometric view of the player's head. You can use either a Minecraft username or UUID.

https://identicraft.js.org/cube/{username_or_uuid}/{size}.png
cube render

Full Body

Returns a full-body render (head, torso, arms, legs) of the player's skin. You can use either a Minecraft username or UUID.

https://identicraft.js.org/body/{username_or_uuid}/{size}.png
body render

Bust Body

Returns a bust render (head, torso, arms) of the player's skin. You can use either a Minecraft username or UUID.

https://identicraft.js.org/bust/{username_or_uuid}/{size}.png
bust render

Player Skin

Returns the raw Minecraft skin texture of any registered players.

https://identicraft.js.org/skin/{username_or_uuid}
skin render

API Endpoints

Below is the list of API endpoints used by this project:

  1. 2D Avatar (Simple)
  2. GET /avatar/{username_or_uuid}/{size}.png
    GET /avatar/{username_or_uuid} // Defaults to 512px
  3. 3D Avatar (Isometric)
  4. GET /cube/{username_or_uuid}/{size}.png
    GET /cube/{username_or_uuid} // Defaults to 512px
  5. Full Body
  6. GET /body/{username_or_uuid}/{size}.png
    GET /body/{username_or_uuid} // Defaults to 512px
  7. Bust Body
  8. GET /bust/{username_or_uuid}/{size}.png
    GET /bust/{username_or_uuid} // Defaults to 512px
  9. Player Skin
  10. GET /skin/{username_or_uuid}
    // Defaults to 64px because of how Minecraft Skin Works

If the size is not specified on the API, it will default to 512px.

API References

MethodParametersReturnsDescription
renderAvatar(username, size?)username: string, size: numberPromise<Buffer>Render 2D avatar head
renderCube(username, size?)username: string, size: numberPromise<Buffer>Render 3D isometric head
renderBody(username, size?)username: string, size: numberPromise<Buffer>Render full body
renderBust(username, size?)username: string, size: numberPromise<Buffer>Render half body
getSkin(username)username: stringPromise<Buffer>Get raw skin texture
render(type, username, size?)type: string, username: string, size: numberPromise<Buffer>Universal render method
resolveUUID(username)username: stringPromise<string>Convert username to UUID
getSkinURL(uuid)uuid: stringPromise<string>Get skin texture URL

CLI

You can render avatar, cube, full body, bust, and skin using the CLI.

    Here's how to do it:
  1. Download this repository
  2. Ensure Node.js is already installed on v22 or above
  3. Extract and open the repository folder
  4. Open a terminal and run the following commands
npm install
npm link
npm run cli

To use the CLI, these are the commands available

== Long form ==
identicraft cube YOUR_USERNAME -output ANY_FILENAME_YOU_WANT.png

== Short form ==
idc cube YOUR_USERNAME -o ANY_FILENAME_YOU_WANT.png

== With custom size ==
idc avatar itsShiroharu -o shiroharu_face.png -s 256

== Full body render ==
idc body itsShiroharu -o shiroharu_body.png

== Get raw skin ==
idc skin itsShiroharu -o shiroharu_skin.png
FlagLong FormDescription
-o--output [file]Output file path (default: output.png)
-s--size [size]Size in pixels 8-512 (default: 512)
-h--helpDisplay help
-V--versionDisplay version
Render TypesDescription
avatar2D head (front-facing)
cube3D isometric head
bodyFull body render
bustHalf body (torso + head)
skinRaw skin texture

NPM Package

You can use this package in your project.

Install in your project:

npm install identicraft

ES6 Imports (Recommended):

import Identicraft from 'identicraft';
import { writeFileSync } from 'fs';

// Render avatar
const avatar = await Identicraft.renderAvatar('itsShiroharu', 256);
writeFileSync('shiroharu-avatar.png', avatar);

// Render cube
const cube = await Identicraft.renderCube('itsShiroharu', 128);
writeFileSync('shiroharu-cube.png', cube);

// Render body
const body = await Identicraft.renderBody('itsShiroharu', 256);
writeFileSync('shiroharu-body.png', body);

// Render bust
const bust = await Identicraft.renderBust('itsShiroharu', 128);
writeFileSync('shiroharu-bust.png', bust);

// Get raw skin
const skin = await Identicraft.getSkin('itsShiroharu');
writeFileSync('shiroharu-skin.png', skin);

// Universal render method
const image = await Identicraft.render('cube', 'itsShiroharu', 256);
writeFileSync('shiroharu-cube.png', image);

// Resolve UUID
const uuid = await Identicraft.resolveUUID('itsShiroharu');
console.log(uuid);

// Get skin URL
const skinURL = await Identicraft.getSkinURL(uuid);
console.log(skinURL);

CommonJS (Require):

const Identicraft = require('identicraft').default;
const { writeFileSync } = require('fs');

(async () => {
  const avatar = await Identicraft.renderAvatar('itsShiroharu', 256);
  writeFileSync('itsShiroharu.png', avatar);
})();

Named Imports:

import { renderAvatar, renderCube, resolveUUID } from 'identicraft';

const uuid = await resolveUUID('itsShiroharu');
const avatar = await renderAvatar('itsShiroharu', 128);
const cube = await renderCube('itsShiroharu', 256);

License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2025 Shengwei Xiong

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.