MinecraftSkinUtil
A lightweight and simple utility that allows you to create images of different parts and positions from a Minecraft player's current skin texture. Useful for creating player skin previews, avatars, and profile pictures.
Basic useful feature list:
Requirements:
This utility must be used with my fork of the Mojang AccountsClient library ( https://git.io/vMyBn ).
This dependency is automatically included when compiling with Maven since it is defined in the POM definition and obtained from the repository at https://deadmandungeons.com/artifactory/public
Using AccountsClient, you can get current profile information on a player through the Mojang API. Either retrieve a player's Profile by username which includes their unique ID, or retrieve a player's MinecraftProfile by ID which also includes their skin and cape texture information.
All methods of MinecraftSkinUtil accept the MinecraftProfile for the player who's skin should be retrieved since it contains the texture information necessary to construct the images.
Compiling:
Using Maven, simply add the following repository and dependency to your project POM definition:
Example Usage:
Get an image of a player's face that is 64x64 in size (or 8 times larger than original 1x1 pixel scale since player faces are 8x8 pixels):
Get an image of a player's front position:
Convert SkinImage result to other useful formats:
These examples in practice:
Face Result:
Front Result:
Planed Features:
A lightweight and simple utility that allows you to create images of different parts and positions from a Minecraft player's current skin texture. Useful for creating player skin previews, avatars, and profile pictures.
Basic useful feature list:
- Works with all skin types: 64x32, 64x64, slim, and legacy
- Applies skin "jacket" overlay where applicable while maintaining opacity
- Uses appropriate default skin ("Steve" or "Alex") when the player has no skin
- Convenient conversion of image to byte array and data URI
- Easily extensible to create different positions from skin parts
Requirements:
This utility must be used with my fork of the Mojang AccountsClient library ( https://git.io/vMyBn ).
This dependency is automatically included when compiling with Maven since it is defined in the POM definition and obtained from the repository at https://deadmandungeons.com/artifactory/public
Using AccountsClient, you can get current profile information on a player through the Mojang API. Either retrieve a player's Profile by username which includes their unique ID, or retrieve a player's MinecraftProfile by ID which also includes their skin and cape texture information.
All methods of MinecraftSkinUtil accept the MinecraftProfile for the player who's skin should be retrieved since it contains the texture information necessary to construct the images.
Compiling:
Using Maven, simply add the following repository and dependency to your project POM definition:
HTML:
<repository>
<id> deadman-dungeons < / id>
<url> https://deadmandungeons.com/artifactory/public < / url>
< / repository>
<id> deadman-dungeons < / id>
<url> https://deadmandungeons.com/artifactory/public < / url>
< / repository>
HTML:
<dependency>
<groupId> com.deadmandungeons < / groupId>
<artifactId> mc-skin-util < / artifactId>
<version> 1.0.0 < / version>
< / dependency>
<groupId> com.deadmandungeons < / groupId>
<artifactId> mc-skin-util < / artifactId>
<version> 1.0.0 < / version>
< / dependency>
Example Usage:
Get an image of a player's face that is 64x64 in size (or 8 times larger than original 1x1 pixel scale since player faces are 8x8 pixels):
Code (Text):
SkinImage face = MinecraftSkinUtil.getPlayerSkinPart(profile, SkinPart.HEAD_FRONT, 8);
Code (Text):
SkinImage front = MinecraftSkinUtil.getPlayerSkinFront(profile, 8)
Code (Text):
BufferedImage image = front.getImage();
byte[] imageData = front.toByteArray();
String imageDataUri = front.toDataUri();
byte[] imageData = front.toByteArray();
String imageDataUri = front.toDataUri();
Code (Text):
UUID id = UUID.fromString("fc346643-0f0c-4830-8534-c50dac0b331d");
MinecraftProfileRepository repository = new HttpProfileRepository();
MinecraftProfile profile = repository.findProfileById(id);
SkinImage face = MinecraftSkinUtil.getPlayerSkinPart(profile, SkinPart.HEAD_FRONT, 8);
String faceHtml = "<img src=\"" + face.toDataUri() + "\" />";
SkinImage front = MinecraftSkinUtil.getPlayerSkinFront(profile, 8);
String frontHtml = "<img src=\"" + front.toDataUri() + "\" />";
MinecraftProfileRepository repository = new HttpProfileRepository();
MinecraftProfile profile = repository.findProfileById(id);
SkinImage face = MinecraftSkinUtil.getPlayerSkinPart(profile, SkinPart.HEAD_FRONT, 8);
String faceHtml = "<img src=\"" + face.toDataUri() + "\" />";
SkinImage front = MinecraftSkinUtil.getPlayerSkinFront(profile, 8);
String frontHtml = "<img src=\"" + front.toDataUri() + "\" />";
Face Result:
Front Result:
Planed Features:
- Include player cape as a SkinPart
- Option to include player cape in skin positions
- Option to show player cape as when Elytra is equipped
Quick facts
- Edition: Minecraft Java
- File type: .jar
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
MinecraftSkinUtil - Java utility for creating images from skin textures is a free Minecraft Java mod. Downloaded 201 times (via Spigot). Download it and open it directly in the game.