Hi, how can i get a skull with a custom texture? Skull that i want: /give @p skull 1 3 {display:{Name:"Scared"},SkullOwner:{Id:"2cd3dbb5-6136-4127-9e14-89c328660871",Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjM2ZTI2YzQ0NjU5ZTgxNDhlZDU4YWE3OWU0ZDYwZGI1OTVmNDI2NDQyMTE2ZjgxYjU0MTVjMjQ0NmVkOCJ9fX0="}]}}} if i put the code up here (in yellow), the skull in the inventory is a steve head with any skin/owner
It is. You need to follow the tutorial, @rMATTEO. I was actually interested in something like this, too, so thanks @bwfcwalshy. Once you follow the steps you can use: Code: player.getInventory().addItem(Skull.getCustomSkull("http://textures.minecraft.net/texture/7c57f9192e81eb6897c24ecd4935cfb5a731a6f9a57abb51f2b35e8b4be7ebc"); Spoiler (Move your mouse to the spoiler area to reveal the content) Show Spoiler Hide Spoiler I think you need to use this util, I didn't really read through the tutorial as I'm quite busy with work currently.
@rMATTEO, no problem I would try to provide another example, but without my IDE/Testing I'm not sure if it will be correct. I'll give it a go, I guess. (This is also assuming that the Skull is an ItemStack able to be put into an inventory - Edit: It's an itemstack. ItemStack (Move your mouse to reveal the content) ItemStack (open) ItemStack (close) Code: public static ItemStack getCustomSkull(String url) { GameProfile profile = new GameProfile(UUID.randomUUID(), null); PropertyMap propertyMap = profile.getProperties(); if (propertyMap == null) { throw new IllegalStateException("Profile doesn't contain a property map"); } byte[] encodedData = base64.encode(String.format("{textures:{SKIN:{url:\"%s\"}}}", url).getBytes()); propertyMap.put("textures", new Property("textures", new String(encodedData))); ItemStack head = new ItemStack(Material.SKULL_ITEM, 1, (short) 3); ItemMeta headMeta = head.getItemMeta(); Class<?> headMetaClass = headMeta.getClass(); Reflections.getField(headMetaClass, "profile", GameProfile.class).set(headMeta, profile); head.setItemMeta(headMeta); return head; } Code: Inventory inv = new Bukkit.createInventory(/*inventory owner, or null*/, /*multiple of 9*/, "Inventory Name"); inv.setItem(/*place in the inventory smaller than the multiple of 9 ^*/, Skull.getCustomSkull("URL")); Player p = e.getPlayer(); // or if it's a command: Player p = (Player) sender; p.openInventory(inv); Also, noob question lol, but does anyone know if it's possible to get the code to have java highlight (if possible)?