From e3cb1666d979479f429c4927f4267369414323f8 Mon Sep 17 00:00:00 2001 From: agentdid127 Date: Sat, 5 Jan 2019 00:15:26 -0500 Subject: [PATCH] Added Head give functionality Quickly threw the functionality for head giving to the site. Just paste the URL in the head section, select it, and you are good to go! --- js/main.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/js/main.js b/js/main.js index a427b9f..61f9696 100644 --- a/js/main.js +++ b/js/main.js @@ -454,6 +454,23 @@ function updateUI(){ } function generateCode(){ + if(equipCustomHeadMode == "url-head"){ + var code = "/give @p minecraft:head 1 3 {"; + + // Old entity name + if(mcVersion == "1.8" || mcVersion == "1.9"){ + code = "/give @p minecraft:head 1 3 {"; + } + + var tags = []; + + tags.push(getHeadItem()); + + code += tags.join(","); + code += "}"; + return code; + } + else{ var code = "/summon armor_stand ~ ~ ~ {"; // Old entity name @@ -554,6 +571,7 @@ function generateCode(){ code += tags.join(","); code += "}"; return code; + } } function getHandRightItem(){ @@ -642,6 +660,14 @@ function getHeadItem(){ } } + + // use URL to create head + // Best reference: http://redd.it/24quwx + else if(equipCustomHeadMode == "url-head"){ + var uuid = generateUUID(); + var base64Value = btoa('{textures:{SKIN:{url:"'+equipHelmet+'"}}}'); + + return 'SkullOwner:{Id:'+uuid+',Properties:{textures:[{Value:'+base64Value+'}]}}'; }