mirror of
https://github.com/haselkern/Minecraft-ArmorStand.git
synced 2025-05-17 15:05:33 +00:00
Merge pull request #37 from githubcatw/give_patch
Add support for /give commands
This commit is contained in:
commit
4ad39b87f6
2 changed files with 23 additions and 7 deletions
|
@ -221,6 +221,7 @@
|
||||||
|
|
||||||
<div class="padding">
|
<div class="padding">
|
||||||
<!-- THANK YOU to reddit user Oozebull for this part. -->
|
<!-- THANK YOU to reddit user Oozebull for this part. -->
|
||||||
|
<label><input type="checkbox" id="slashgive" name="slashgive">Make /give</label>
|
||||||
<label><input type="checkbox" name="usedisabledslots">Lock Slot Interaction</label>
|
<label><input type="checkbox" name="usedisabledslots">Lock Slot Interaction</label>
|
||||||
<div id="disabledslots">
|
<div id="disabledslots">
|
||||||
<div>
|
<div>
|
||||||
|
|
29
js/main.js
29
js/main.js
|
@ -41,6 +41,7 @@ var showArms = false;
|
||||||
var small = false;
|
var small = false;
|
||||||
var marker = false;
|
var marker = false;
|
||||||
var centercorrected = false;
|
var centercorrected = false;
|
||||||
|
var give = false;
|
||||||
|
|
||||||
var useEquipment;
|
var useEquipment;
|
||||||
var equipHandRight;
|
var equipHandRight;
|
||||||
|
@ -372,7 +373,7 @@ function handleInput(){
|
||||||
nameStrikethrough = getCheckBoxInput("namestrikethrough");
|
nameStrikethrough = getCheckBoxInput("namestrikethrough");
|
||||||
|
|
||||||
useDisabledSlots = getCheckBoxInput("usedisabledslots");
|
useDisabledSlots = getCheckBoxInput("usedisabledslots");
|
||||||
|
give = getCheckBoxInput("slashgive");
|
||||||
|
|
||||||
body.set(getRangeInput("bodyX"), getRangeInput("bodyY"), getRangeInput("bodyZ"));
|
body.set(getRangeInput("bodyX"), getRangeInput("bodyY"), getRangeInput("bodyZ"));
|
||||||
head.set(getRangeInput("headX"), getRangeInput("headY"), getRangeInput("headZ"));
|
head.set(getRangeInput("headX"), getRangeInput("headY"), getRangeInput("headZ"));
|
||||||
|
@ -526,13 +527,21 @@ function updateUI(){
|
||||||
function generateCode(){
|
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
|
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 (!give) {
|
||||||
if(mcVersion == "1.8" || mcVersion == "1.9"){
|
// Old entity name
|
||||||
code = "/summon ArmorStand ~ ~ ~ {";
|
if(mcVersion == "1.8" || mcVersion == "1.9"){
|
||||||
} else if (mcVersion == "1.11") {
|
code = "/summon ArmorStand ~ ~ ~ {";
|
||||||
code = "/summon armor_stand ~ ~ ~ {";
|
} else if (mcVersion == "1.11") {
|
||||||
|
code = "/summon armor_stand ~ ~ ~ {";
|
||||||
|
} else {
|
||||||
|
centercorrected ? code = "/summon armor_stand ~ ~-0.5 ~ {" : code = "/summon armor_stand ~ ~ ~ {"
|
||||||
|
}
|
||||||
} else {
|
} 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 = [];
|
var tags = [];
|
||||||
|
@ -682,6 +691,12 @@ function generateCode(){
|
||||||
|
|
||||||
code += tags.join(",");
|
code += tags.join(",");
|
||||||
code += "}";
|
code += "}";
|
||||||
|
if (give) {
|
||||||
|
code += "}";
|
||||||
|
if (mcVersion != "1.8" && mcVersion != "1.9" && mcVersion != "1.11") {
|
||||||
|
code += " 1"
|
||||||
|
}
|
||||||
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue