Solved Custom Heads

Discussion in 'Plugin Development' started by Hex_27, Sep 26, 2015.

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

    Hex_27

    Is there a way to set a skull block as a custom head, and check too see what custom head it is?
     
  2. Offline

    Reynergodoy

    ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
    SkullMeta meta = (SkullMeta) skull.getItemMeta();
    meta.setOwner();
    skull.setItemMeta(meta);
    p.getInventory().setHelmet(skull);
     
    epe07 likes this.
  3. Offline

    Hex_27

    @Reynergodoy
    No. I need to set the BLOCK. An existing block that was set by code.
     
  4. Offline

    Hex_27

  5. Offline

    SuperSniper

    @Hex_27 What im getting from here is: You want to set a block by code, and then set the meta for that block, to make it a player skull?
     
  6. Offline

    Hex_27

    @SuperSniper
    Yes, and also be able to check the player skull name of the skull block
     
  7. Offline

    SuperSniper

    @Hex_27

    Code:
    Skull skull = // Create Skull Block Code
    SkullMeta skull_meta = skull.getItemMeta();
    skull_meta.SOMETHING);
    
    Methods for SkullMeta:

    String getOwner()
    Gets the owner of the skull.
    boolean hasOwner()
    Checks to see if the skull has an owner.
    boolean setOwner(String owner)
     
  8. Offline

    Hex_27

  9. Offline

    Hex_27

    @SuperSniper there's no such method under Skull.

    Nevermind, figured it out
     
    Last edited by a moderator: Sep 29, 2015
Thread Status:
Not open for further replies.

Share This Page