-
MINECRAFT ARMOR STAND
Please note:
- This thing is nowhere near complete, I just wanted to upload it so I don't lose my work if my local copy messes up.
+
MINECRAFT ARMOR STAND
+
+ Check it on GitHub
+
+
-
+
+
+
+ + Tips and Tricks for your Armor Stand
+
+
+
+
+
+ If your command is longer than 100 characters, it needs to be executed with a command block. Obtain one by typing:
+
+
+ /give @p command_block
+
+
+
+
+ You can give the armor stand a custom player head! Just replace Notch with an username of your choice.
+
+
+ /give @p skull 1 3 {SkullOwner:"Notch"}
+
+
+
+
+ You can use the following command to fully customise the equipment of your armorstand.
+ In order for it to work, you have to put a command block close to the armorstand you want to edit. (Notice the r=2, where the r is radius.)
+
+
+ /entitydata @e[r=2,ArmorStand] {Equipment:[{id:"iron_sword",Count:1b},{id:"iron_boots",Count:1b},{id:"iron_leggings",Count:1b},{id:"iron_chestplate",Count:1b},{id:"iron_helmet",Count:1b}]}
+
+
+
+
+ If you are a mapmaker you might not want players to take items out of the armor stand. If you want to lock all slots, replace n with 1 (or 0 if you want to unlock it).
+ If you want to
disable specific slots, you have to add the numbers in following table up, and replace n with your result.
+
+ Boots | 2 |
+ Leggings | 4 |
+ Chestplate | 8 |
+ Helmet/Block | 16 |
+ Sword/Block | Not working :( |
+
+
+
+ /entitydata @e[r=2,ArmorStand] {DisabledSlots:n}
+
+
+
\ No newline at end of file
diff --git a/main.js b/main.js
index 5ea699f..840277b 100644
--- a/main.js
+++ b/main.js
@@ -39,6 +39,7 @@ var rightLeg = new THREE.Vector3(0,0,0);
var leftArm = new THREE.Vector3(0,0,0);
var rightArm = new THREE.Vector3(0,0,0);
var rotation = 0;
+var vec0 = new THREE.Vector3(0,0,0); // We use this to determine if we want a pose in the command.
//Stuff for mouse movements
var mouseDownX;
@@ -53,10 +54,12 @@ Point = {
};
$(document).ready(function(){
+ //Init
setup();
updateUI();
render();
+ //Stuff to handle input
$("input").on("input", function(){
handleInput();
});
@@ -64,6 +67,7 @@ $(document).ready(function(){
handleInput();
});
+ //Handle rotating with mouse
$("#gl")
.mousedown(function(event){
mouseDownX = event.pageX;
@@ -79,6 +83,9 @@ $(document).ready(function(){
mouseDownX = null;
mouseDownY = null;
});
+
+ //Tips and tricks
+ $("#tipsntricks").hide();
});
function setup(){
@@ -246,6 +253,9 @@ function updateUI(){
else
$("#inputarms").hide();
$("#code").text(generateCode());
+ if(generateCode().length > 100){
+ $("#codeinfo").html("
Please note: This command is too long to be executed from chat. You need to place it inside a command block. (See tips and tricks below.)");
+ }
// Rotate 3D Stuff
// y and z rotation needs to be inverted
@@ -267,6 +277,7 @@ function generateCode(){
var tags = [];
+ //CheckBoxes
if(invisible)
tags.push("Invisible:1b");
if(invulnerable)
@@ -280,12 +291,43 @@ function generateCode(){
if(small)
tags.push("Small:1b");
+ //Sliders
+ if(rotation != 0)
+ tags.push("Rotation:["+rotation+"f]");
+
+ //Now the pose
+ var pose = [];
+ if(!isZero(body))
+ pose.push("Body:"+getJSONArray(body));
+ if(!isZero(head))
+ pose.push("Head:"+getJSONArray(head));
+ if(!isZero(leftLeg))
+ pose.push("LeftLeg:"+getJSONArray(leftLeg));
+ if(!isZero(rightLeg))
+ pose.push("RightLeg:"+getJSONArray(rightLeg));
+ if(showArms){
+ if(!isZero(leftArm))
+ pose.push("LeftArm:"+getJSONArray(leftArm));
+ if(!isZero(rightArm))
+ pose.push("LeftArm:"+getJSONArray(rightArm));
+ }
+
+
+ if(pose.length > 0)
+ tags.push("Pose:{"+pose.join(",")+"}");
code += tags.join(",");
code += "}";
return code;
}
+function isZero(vector){
+ return vector.x == 0 && vector.y == 0 && vector.z == 0;
+}
+function getJSONArray(vector){
+ return "["+vector.x+"f,"+vector.y+"f,"+vector.z+"f]";
+}
+
function getMouseDeltaX(){
var mouseDeltaX = 0;
if(mouseDownX != null && mouseMoveX != null){
diff --git a/style.css b/style.css
index da7cd22..adef2cd 100644
--- a/style.css
+++ b/style.css
@@ -15,6 +15,21 @@ body{
background-color: #dddddd;
}
+div{
+ padding: 0;
+ margin: 0;
+}
+
+h1{
+ text-align: center;
+ font-family: "Oswald", sans-serif;
+ margin: 0;
+}
+
+a{
+ color: #000000;
+}
+
#gl{
width: 60%;
height: 100%;
@@ -22,24 +37,21 @@ body{
cursor: move;
}
-#controls{
+#card{
background-color: #ffffff;
box-shadow: 0 2px 4px #555555;
- margin: 1em;
+ margin: 0.5em;
margin-left: 60%;
}
-#inputsection{
- margin: 0.5em;
-}
-#code{
- margin: 0.5em;
+.padding{
padding: 0.5em;
- font-style: italic;
- word-wrap: break-word;
}
-h1{
- text-align: center;
- font-family: "Oswald", sans-serif;
+.code{
+ word-wrap: break-word;
+ padding: 1em;
+ font-family: monospace;
+ background-color: #37474f;
+ color: #ffffff;
}
\ No newline at end of file