Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static ItemStack createNonOwnerSkull(String name, String url, ArrayList<String> lores) {
- ItemStack item = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal());
- item.setDurability((short)3);
- SkullMeta meta = (SkullMeta) item.getItemMeta();
- meta.setDisplayName("§a" + name);
- meta.setLore(lores);
- GameProfile gp = new GameProfile(java.util.UUID.randomUUID(), null);
- gp.getProperties().put("textures", new Property("textures", new String(url)));
- Field lf = null;
- try {
- lf = meta.getClass().getDeclaredField("profile");
- lf.setAccessible(true);
- lf.set(meta, gp);
- } catch (NoSuchFieldException e) {
- } catch (IllegalArgumentException e) {
- } catch (IllegalAccessException e) {
- }
- item.setItemMeta(meta);
- return item;
- }
Advertisement
Add Comment
Please, Sign In to add comment