mirror of
https://github.com/haselkern/Minecraft-ArmorStand.git
synced 2025-05-17 15:05:33 +00:00
parent
dcbd16ae40
commit
b9ebbaf20c
1 changed files with 31 additions and 19 deletions
36
js/main.js
36
js/main.js
|
@ -531,7 +531,7 @@ function generateCode(){
|
|||
code = "/summon ArmorStand ~ ~ ~ {";
|
||||
} else if (mcVersion == "1.11") {
|
||||
code = "/summon armor_stand ~ ~ ~ {";
|
||||
} else if (mcVersion == "1.13") {
|
||||
} else {
|
||||
centercorrected ? code = "/summon armor_stand ~ ~-0.5 ~ {" : code = "/summon armor_stand ~ ~ ~ {"
|
||||
}
|
||||
|
||||
|
@ -619,11 +619,15 @@ function generateCode(){
|
|||
}
|
||||
|
||||
// Custom name
|
||||
if(customName != "" && customName != null)
|
||||
//New 1.13 format
|
||||
if (mcVersion == "1.13") {
|
||||
var name = [];
|
||||
|
||||
if(customName) {
|
||||
let name = [];
|
||||
switch (mcVersion) {
|
||||
case "1.8":
|
||||
case "1.9":
|
||||
case "1.11":
|
||||
tags.push(`CustomName:"${customName}"`);
|
||||
break;
|
||||
case "1.13":
|
||||
name.push(getName());
|
||||
name.push(getNameColor());
|
||||
name.push(getNameBold());
|
||||
|
@ -631,14 +635,22 @@ function generateCode(){
|
|||
name.push(getNameObfuscated());
|
||||
name.push(getNameStrikethrough());
|
||||
|
||||
//tags.push(`CustomName:\"${customName}\"`)
|
||||
tags.push(`CustomName:"{${name.join("")}}"`)
|
||||
//Old format
|
||||
} else {
|
||||
tags.push(`CustomName:\"${customName}\"`)
|
||||
tags.push(`CustomName:"{${name.join("")}}"`);
|
||||
break;
|
||||
default:
|
||||
// CustomNames from 1.14+ can now use single quotes to contain json
|
||||
// Replace escaped double quotes with single quotes to make it look pretty
|
||||
name.push(getName().replaceAll("\\", ""));
|
||||
name.push(getNameColor().replaceAll("\\", ""));
|
||||
name.push(getNameBold().replaceAll("\\", ""));
|
||||
name.push(getNameItalic().replaceAll("\\", ""));
|
||||
name.push(getNameObfuscated().replaceAll("\\", ""));
|
||||
name.push(getNameStrikethrough().replaceAll("\\", ""));
|
||||
tags.push(`CustomName:'{${name.join("")}}'`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//mcVersion == "1.13" ? tags.push(`CustomName:"\\"${customName}\\""`) : tags.push("CustomName:\""+customName+"\"")
|
||||
if(showCustomName)
|
||||
tags.push("CustomNameVisible:1b");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue