Solved How to get skull player

Discussion in 'Plugin Development' started by Kolia1_1, Apr 3, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    Kolia1_1

    How do I get a realm player's head


    Screenshot_46.png

    CODE:

    p.getInventory().clear();
    ItemStack SkullProfile = new ItemStack(Material.SKULL_ITEM);
    ItemMeta SkullProfileMeta = SkullProfile.getItemMeta();
    SkullProfileMeta.setDisplayName(ChatColor.YELLOW + "You Profile");
    List<String> SkullProfileLore = new ArrayList<String>();
    SkullProfileLore.add(ChatColor.GRAY + "Your Game Profile ");
    SkullProfileMeta.setLore(SkullProfileLore);
    SkullProfile.setItemMeta(SkullProfileMeta);
    p.getInventory().setItem(1, SkullProfile);
     
  2. Offline

    Zombie_Striker

    @Kolia1_1
    Change SjullProfileMeta to a SkullMeta (you will need to add a cast as-well) and then use SkullMeta#setOwner(Player's name) to get the player's head.
     
Thread Status:
Not open for further replies.

Share This Page