Heads

Discussion in 'Plugin Help/Development/Requests' started by Just_Jitse, Dec 26, 2014.

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

    Just_Jitse

    Hello,

    So what I want to do is by command spawning a head in the inventory with the skin of the player who send the command, but just the skin( like the Profile on hypixel), the displayname and itemmeta need to be adjustable. Does someone know how to do that.

    please does somebody know this??

    <Edit by mrCookieSlime: Merged posts. Please don't double post. There is an Edit Button right next to the Date.>
     
    Last edited by a moderator: Dec 26, 2014
  2. Offline

    Unica

  3. Offline

    mine-care

    @Just_Jitseh please don't bump in less than 24 hours from your initial post or previous bump
     
  4. Offline

    Just_Jitse

    If you use the skullmeta for that @Unica, then if the name of the skull "PlayerName's head". If this happens then I cant change the displayname. :/ But what does the Clone statement?
     
  5. Offline

    DemKazoo

    So all you want it just the skin of the player without a name.. Ok?

    Anyways, try looping trough all online players, check if the player has a skull in it's inventory, and then rename it to balbla.


    Code:
    if(p.getInventory().contains(Material.SKULL);
    //Do something
    I don't know if it works, did this without IDE
     
  6. Offline

    Just_Jitse

    @DemKazoo
    Yeah that is what I want, a players head without a name :) I know it is possible because hypixel dev did it.
     
    Last edited: Dec 26, 2014
  7. Offline

    Xtreme727

    new ItemStack(Material.SKULL, 1, (short) 3)? Or setDisplayName if you mean item name
    NOTE - Go into a Vanilla Single-Player mode, and do the F3+H trick. Just look at all the data values, it helped me
     
  8. Offline

    Just_Jitse

  9. Offline

    Xtreme727

    Code:
    item.setDisplayName(String dName);
    But again for player skulls use the data value :3
     
  10. Offline

    Just_Jitse

    @Xtreme727 srry but what are data values? I there a website or can you explain them?
     
  11. Offline

    Xtreme727

    A data value is a value that can modify the item/block. For example, Material.SKULL, 1, (short) 1 will make it a wither skeleton skull. Material.SKULL, 1, (short) 3 will make it a player skull. They are for anything. F/E: You can change the color of wool(Yes there is diff way to do this >.>) by doing Material.WOOL, 1, (short) 14 to make it red.
     
  12. Offline

    Just_Jitse

    @Xtreme727
    oww yeah that data I know that :) But then you could only make the heads that mojang created. I want to create a head with the skin of the player. I know it is possible but I don't know how.
     
  13. Offline

    Xtreme727

    Oh that is a 1.8 feature that the Hypixel Developer was using. In 1.8, heads that are assigned to a player appear with the head skin.
     
  14. Offline

    Just_Jitse

    I have a 1.8 spigot server/API, so that is no problem @Xtreme727

    Do you know how to assign a player to that skull then @Xtreme727 ?

    <Edit by mrCookieSlime: Merged posts. Please don't double post. There is an Edit Button right next to the Date.>
     
    Last edited by a moderator: Dec 26, 2014
  15. Offline

    Xtreme727

    You should be able to use SkullMeta if you are using full 1.8.
     
  16. Offline

    Just_Jitse

    I can't change the skin by editing the SkullMeta :/ is there something else I could try? @Xtreme727
     
  17. Offline

    Xtreme727

    You don't edit the skin using the skullmeta, you edit it so it is the PLAYER's head, that way when seen in game I believe it should show up as the player's head
     
  18. Offline

    Just_Jitse

    Arrgg @Xtreme727 ,
    I want a head with a name I can adjust so the name is for example on hypixel : Your Profile. This Item with the name "Your Profile" is a head with in the HOTBAR a skin of the player which is playing on the server. (so not PLAYER's head)
     
  19. Offline

    Xtreme727

    Something like ยป
    Code:
    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
       ItemStack head = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
       SkullMeta hMeta = (SkullMeta) head.getItemMeta();
       hMeta.setOwner(event.getPlayer().getName());
       hMeta.setDisplayName(/*Insert DisplayName*/);
       head.setItemMeta(hMeta);
    
       event.getPlayer().getInventory().addItem(head);
    }
    
     
  20. Offline

    Just_Jitse

    @Xtreme727 When I join the server with that code I just get the head(Yes, with the name :) ) But I need to place it and break the skull, and then I get the skull WITH skin in my hotbar. When I break the skull the ItemMeta changes to the PLAYER's head again. :/
     
  21. Offline

    Xtreme727

    Try adding some delay possibly
     
  22. Offline

    mrCookieSlime Retired Staff

    Moved to Alternatives Section.
     
  23. Offline

    Just_Jitse

    @Xtreme727
    hmm, I'll try it ;)

    sorry @mrCookieSlime xD

    <Edit by mrCookieSlime: Merged posts. Please don't double post. There is an Edit Button right next to the Date.>
     
Thread Status:
Not open for further replies.

Share This Page