Jump to content

Get custom Player_Head (skull) with custom name as ItemStack (1.12.2)


EM3R50N

Recommended Posts

I found an old thread from WARDOGSK93 on how to give a custom player_head skull as an ItemStack but thread got locked because it was so old. Just wanted to share the method I made (updated to be 1.12.2 compatible) for this (I added giving it a custom name too). 

    // REFERENCE: http://www.minecraftforge.net/forum/topic/24228-solved-1710-player-skulls/    	
    private ItemStack GetCustomHead(String playerName, String headName) {	    	
    	ItemStack customHead = new ItemStack(Items.field_151144_bL, 1, 3);    
    	customHead.setTag(new NBTTagCompound()); 
    	customHead.getTag().setTag("SkullOwner", new NBTTagString(playerName));      	
    	customHead.getOrCreateChildTag("display").setString("Name",headName);   
    	return customHead;    	    
    }

 

@WARDOGSK93 - Thank you again if you're still out there!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.