[Player Heads]

Discussion in 'Plugin Development' started by SugarCraft, Mar 6, 2013.

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

    SugarCraft

    Hey! I'm creating a plugin to make it so if you do /staff there's a bunch of player heads there, with the names of all the server staff. But, I'm having trouble adding it. I know how to add materials, though not player heads. Any help is appreciated.
     
  2. Offline

    Lecrayen

    It may have to do with editing the minecraft code, like spawning player npcs, but I'm not sure
     
  3. Offline

    SugarCraft

    Oh.. Ill go google that. Any other ideas?

    By the way, if I cant do that do you know how I can item names?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  4. Offline

    chasechocolate

    SugarCraft Heads as in skulls (like wither skulls, zombie skulls, and creeper skulls)? You can do that:
    Code:java
    1. ItemStack skull = new ItemStack(Material.SKULL_ITEM);
    2. SkullMeta meta = (SkullMeta) skull.getItemMeta();
    3. meta.setOwner("chasechocolate");
    4. skull.setItemMeta(meta);
     
  5. Offline

    Phasesaber

    That just shows up as a skeleton skull.
     
  6. Offline

    MooshViolet

    Phasesaber change the name "chasechocolate" to your player name
     
  7. Offline

    Loogeh

    Phasesaber Right now you're only using the SKULL_ITEM without setting a durability. That means that it's a Skeleton head, the durability for a player head is 3.
    Code:
    ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
    That should work when you set the owner now.
     
  8. Offline

    Phasesaber

    Thanks! Works fine!
     
  9. Offline

    Loogeh

    Phasesaber I only just realized that this thread is over 1 year old lol...
    Glad to help, though
     
  10. Offline

    Phasesaber

    I thought it said March of 2014.... :p
     
Thread Status:
Not open for further replies.

Share This Page