Hello Bukkit, I developed this code to take a user's face directly from Mojang for a project a while ago, and thought I'd share it here. This code will take the skin from Mojang's skin servers, crops the head out, and allows you to save it to a database or lets you use it with anything dealing with Images. Recommended for use Asynchronously, as any slowdown in downloading the image from Mojang can cause big problems on the main thread! Code:java import java.awt.Image;import java.awt.image.BufferedImage;import java.io.File;import java.io.IOException;import java.net.MalformedURLException;import java.net.URL; import javax.imageio.ImageIO; import org.bukkit.entity.Player; public class FaceLibrary {//Library by ccrama, can be found at gist.github.com/ccrama/759879cace268a99a548public void saveFace(Player p) {String name = p.getName();URL url = null;if (new File(new Main().getDataFolder() + File.separator+ "FaceLibrary" + File.separator + name + ".png").exists() == false) {try {url = new URL("[url]http://skins.minecraft.net/MinecraftSkins/[/url]"+ name + ".png");} catch (MalformedURLException e1) {e1.printStackTrace();}Image img = null;try {img = ImageIO.read(url);} catch (IOException e1) {e1.printStackTrace();}BufferedImage dest = ((BufferedImage) img).getSubimage(8, 8, 8, 8);File outputfile = new File(new Main().getDataFolder()+ File.separator + "FaceLibrary" + File.separator + name+ ".png"); try {ImageIO.write(dest, "png", outputfile);} catch (IOException e1) {e1.printStackTrace();}}} public BufferedImage getImage(Player p) {String name = p.getName();File imageFile = new File(new Main().getDataFolder() + File.separator+ "FaceLibrary" + File.separator + name + ".png");BufferedImage img = null;try {img = ImageIO.read(imageFile);return img;} catch (IOException e) {System.out.println("Image for " + name + " is invalid!");return null; } } } Usage is simple. Use saveFace(player); on join event, for example, and use getImage(player) to retrieve the image at a later time. I used this to display a user's face with bobacadodl 's ImageMessage and with holograms. The reason for saving it to a database is in the case that Mojang's skin servers are down. You can easily edit this to skip the saving and return an image if you don't want this functionality. This also assumes that the directory /plugins/yourplugin/FaceLibrary/ exists. Github: http://gist.github.com/ccrama/759879cace268a99a548 Post any creative ways you used this library! Cheers, ccrama EDIT: Use the github link, formatting is horrible on Bukkit
Bammerbom Wizehh Here is a post copied directly from the ImageMessage thread My face looks discolored because it's using a bad color detection algorithm. Newest version of bobacadodl 's library will look better.