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
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
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
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
Player Skin
Returns the raw Minecraft skin texture of any registered players.
https://identicraft.js.org/skin/{username_or_uuid}
API Endpoints
Below is the list of API endpoints used by this project:
- 2D Avatar (Simple)
- 3D Avatar (Isometric)
- Full Body
- Bust Body
- Player Skin
GET /avatar/{username_or_uuid}/{size}.png
GET /avatar/{username_or_uuid} // Defaults to 512px
GET /cube/{username_or_uuid}/{size}.png
GET /cube/{username_or_uuid} // Defaults to 512px
GET /body/{username_or_uuid}/{size}.png
GET /body/{username_or_uuid} // Defaults to 512px
GET /bust/{username_or_uuid}/{size}.png
GET /bust/{username_or_uuid} // Defaults to 512px
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
| Method | Parameters | Returns | Description |
|---|---|---|---|
renderAvatar(username, size?) | username: string, size: number | Promise<Buffer> | Render 2D avatar head |
renderCube(username, size?) | username: string, size: number | Promise<Buffer> | Render 3D isometric head |
renderBody(username, size?) | username: string, size: number | Promise<Buffer> | Render full body |
renderBust(username, size?) | username: string, size: number | Promise<Buffer> | Render half body |
getSkin(username) | username: string | Promise<Buffer> | Get raw skin texture |
render(type, username, size?) | type: string, username: string, size: number | Promise<Buffer> | Universal render method |
resolveUUID(username) | username: string | Promise<string> | Convert username to UUID |
getSkinURL(uuid) | uuid: string | Promise<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:
- Download this repository
- Ensure Node.js is already installed on v22 or above
- Extract and open the repository folder
- 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
| Flag | Long Form | Description |
|---|---|---|
-o | --output [file] | Output file path (default: output.png) |
-s | --size [size] | Size in pixels 8-512 (default: 512) |
-h | --help | Display help |
-V | --version | Display version |
| Render Types | Description |
|---|---|
avatar | 2D head (front-facing) |
cube | 3D isometric head |
body | Full body render |
bust | Half body (torso + head) |
skin | Raw 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.