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:
parent
6e97790ca3
commit
57d0cd3e9c
2 changed files with 16 additions and 0 deletions
|
@ -130,6 +130,10 @@
|
|||
</div>
|
||||
<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. -->
|
||||
<label><input type="checkbox" name="usedisabledslots">Lock Slot Interaction</label>
|
||||
<div id="disabledslots" class="padding">
|
||||
|
|
12
js/main.js
12
js/main.js
|
@ -50,6 +50,9 @@ var equipColorLeggings;
|
|||
var equipColorChestplate;
|
||||
var equipColorHelmet;
|
||||
|
||||
var customName;
|
||||
var showCustomName;
|
||||
|
||||
var useDisabledSlots;
|
||||
|
||||
//The rotation values are all in degrees.
|
||||
|
@ -279,6 +282,9 @@ function handleInput(){
|
|||
equipColorChestplate = $("#chestplatecolor").css("background-color");
|
||||
equipColorHelmet = $("#helmetcolor").css("background-color");
|
||||
|
||||
customName = getInput("customname");
|
||||
showCustomName = getCheckBoxInput("showcustomname");
|
||||
|
||||
useDisabledSlots = getCheckBoxInput("usedisabledslots");
|
||||
|
||||
|
||||
|
@ -414,6 +420,12 @@ function generateCode(){
|
|||
tags.push("HandItems:["+hands.join(",")+"]");
|
||||
}
|
||||
|
||||
// Custom name
|
||||
if(customName != "" && customName != null)
|
||||
tags.push("CustomName:\""+customName+"\"");
|
||||
if(showCustomName)
|
||||
tags.push("CustomNameVisible:1b");
|
||||
|
||||
//DisabledSlots
|
||||
if(useDisabledSlots){
|
||||
tags.push("DisabledSlots:"+calculateDisabledSlotsFlag());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue