From 6fb354fa7e3456a0712f75d64052c565decd44f3 Mon Sep 17 00:00:00 2001 From: Narek Torosyan Date: Sun, 27 Dec 2020 17:51:49 +0400 Subject: [PATCH 1/2] Add code for /give --- js/main.js | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/js/main.js b/js/main.js index df4852b..a167a74 100644 --- a/js/main.js +++ b/js/main.js @@ -41,6 +41,7 @@ var showArms = false; var small = false; var marker = false; var centercorrected = false; +var give = false; var useEquipment; var equipHandRight; @@ -526,13 +527,21 @@ function updateUI(){ function generateCode(){ var code = "/summon armor_stand ~ ~ ~ {" //in 1.13, positions are no longer center-corrected. Adding .5 makes it centered. However for players it is already center-corrected - // Old entity name - if(mcVersion == "1.8" || mcVersion == "1.9"){ - code = "/summon ArmorStand ~ ~ ~ {"; - } else if (mcVersion == "1.11") { - code = "/summon armor_stand ~ ~ ~ {"; + if (!give) { + // Old entity name + if(mcVersion == "1.8" || mcVersion == "1.9"){ + code = "/summon ArmorStand ~ ~ ~ {"; + } else if (mcVersion == "1.11") { + code = "/summon armor_stand ~ ~ ~ {"; + } else { + centercorrected ? code = "/summon armor_stand ~ ~-0.5 ~ {" : code = "/summon armor_stand ~ ~ ~ {" + } } else { - centercorrected ? code = "/summon armor_stand ~ ~-0.5 ~ {" : code = "/summon armor_stand ~ ~ ~ {" + if(mcVersion == "1.8" || mcVersion == "1.9" || mcVersion == "1.11"){ + code = "/give @p minecraft:armor_stand 1 0 {EntityTag:{"; + } else { + code = "/give @p armor_stand{EntityTag:{" + } } var tags = []; @@ -682,6 +691,12 @@ function generateCode(){ code += tags.join(","); code += "}"; + if (give) { + code += "}"; + if (mcVersion != "1.8" && mcVersion != "1.9" && mcVersion != "1.11") { + code += " 1" + } + } return code; } From 624fea172a5d7bca54c1ebc2093434530a83ee9d Mon Sep 17 00:00:00 2001 From: Narek Torosyan Date: Sun, 27 Dec 2020 17:58:07 +0400 Subject: [PATCH 2/2] Add checkbox --- index.htm | 1 + js/main.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/index.htm b/index.htm index 0a5a33d..f1b1493 100644 --- a/index.htm +++ b/index.htm @@ -221,6 +221,7 @@
+
diff --git a/js/main.js b/js/main.js index a167a74..0f53024 100644 --- a/js/main.js +++ b/js/main.js @@ -373,7 +373,7 @@ function handleInput(){ nameStrikethrough = getCheckBoxInput("namestrikethrough"); useDisabledSlots = getCheckBoxInput("usedisabledslots"); - + give = getCheckBoxInput("slashgive"); body.set(getRangeInput("bodyX"), getRangeInput("bodyY"), getRangeInput("bodyZ")); head.set(getRangeInput("headX"), getRangeInput("headY"), getRangeInput("headZ"));