Solved How can you set the skin of a placed player head? Block #144

Discussion in 'Plugin Development' started by h8crew, May 8, 2014.

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

    h8crew

    Hey guys, I know how to create a player head item, I have that working just fine. But I can't seem to find anywhere how to change the player head block skin. Any ideas on how to do this?
     
  2. Offline

    tooncool64

    do /give 144 skulltype:NOTCH
    I think...

    h8crew

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  3. Offline

    xTigerRebornx

  4. Offline

    h8crew

    It's not an item stack, it's an already placed block in the world that I'm trying to edit.

    Finally figured it out:


    PHP:
    Block block = new Location (Bukkit.getWorld("lobby"), 14701).getBlock();
           
    BlockState blockState block.getState();
     
    if (
    blockState instanceof Skull)
    {
        
    Skull skull = (SkullblockState;
        
    skull.setOwner(playerName);
        
    skull.update();
    }
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
Thread Status:
Not open for further replies.

Share This Page