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

Support for custom name

This commit is contained in:
Lars Martens 2016-11-23 17:15:38 +01:00
parent 6e97790ca3
commit 57d0cd3e9c
2 changed files with 16 additions and 0 deletions

View file

@ -130,6 +130,10 @@
</div> </div>
<br> <br>
<input type="text" name="customname" placeholder="Custom name">
<label><input type="checkbox" name="showcustomname">Show custom name</label>
<br>
<!-- THANK YOU to reddit user Oozebull for this part. --> <!-- THANK YOU to reddit user Oozebull for this part. -->
<label><input type="checkbox" name="usedisabledslots">Lock Slot Interaction</label> <label><input type="checkbox" name="usedisabledslots">Lock Slot Interaction</label>
<div id="disabledslots" class="padding"> <div id="disabledslots" class="padding">

View file

@ -50,6 +50,9 @@ var equipColorLeggings;
var equipColorChestplate; var equipColorChestplate;
var equipColorHelmet; var equipColorHelmet;
var customName;
var showCustomName;
var useDisabledSlots; var useDisabledSlots;
//The rotation values are all in degrees. //The rotation values are all in degrees.
@ -279,6 +282,9 @@ function handleInput(){
equipColorChestplate = $("#chestplatecolor").css("background-color"); equipColorChestplate = $("#chestplatecolor").css("background-color");
equipColorHelmet = $("#helmetcolor").css("background-color"); equipColorHelmet = $("#helmetcolor").css("background-color");
customName = getInput("customname");
showCustomName = getCheckBoxInput("showcustomname");
useDisabledSlots = getCheckBoxInput("usedisabledslots"); useDisabledSlots = getCheckBoxInput("usedisabledslots");
@ -414,6 +420,12 @@ function generateCode(){
tags.push("HandItems:["+hands.join(",")+"]"); tags.push("HandItems:["+hands.join(",")+"]");
} }
// Custom name
if(customName != "" && customName != null)
tags.push("CustomName:\""+customName+"\"");
if(showCustomName)
tags.push("CustomNameVisible:1b");
//DisabledSlots //DisabledSlots
if(useDisabledSlots){ if(useDisabledSlots){
tags.push("DisabledSlots:"+calculateDisabledSlotsFlag()); tags.push("DisabledSlots:"+calculateDisabledSlotsFlag());