1.16.5 Head material

Discussion in 'Spigot Plugin Development' started by LuckyMunch, Jul 8, 2021.

  1. I am testing and having some fun and I wanted to make an item, I got all the 'attributes' down such as enchants and lore, but for the material I want it to be a specific player head, and I can't find out any way of doing soo! Please help me
    private static void createrandom() {
    ItemStack random = new ItemStack(Material.w);
    ItemMeta meta = random.getItemMeta();
    meta.setDisplayName("§l§cRandom Item");
    List<String> lore = new ArrayList<>();
    lore.add("An axe, forged by the raider...");
    meta.setLore(lore);
    meta.addEnchant(Enchantment.DAMAGE_ALL, 32000, false );
    meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
    meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
    random.setItemMeta(meta);
    random = random;

    }
     
  2. Plenty of guides online: 1, 2.
     
  3. Code (Text):
    ItemStack itemStack = new ItemStack(Material.SKULL_ITEM, 1, (byte) 3);
    SkullMeta skullMeta = itemStack .getItemMeta();
    skullMeta.setOwner(player.getName());
    itemStack .setItemMeta(skullMeta);
     
    • Like Like x 1
  4. This is version 1.16.5. PLAYER_HEAD, not SKULL_ITEM.
     
    • Like Like x 1
  5. Sorry, I did not have a look at the version