1
0
Fork 0
mirror of https://github.com/haselkern/Minecraft-ArmorStand.git synced 2025-05-17 15:05:33 +00:00

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!
This commit is contained in:
agentdid127 2019-01-05 00:15:26 -05:00 committed by GitHub
parent 542593b977
commit e3cb1666d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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+'}]}}';
}