From f201fe94355f230f33602a8ff76afb267c38e3f0 Mon Sep 17 00:00:00 2001 From: Ethan Date: Mon, 27 Feb 2023 18:41:05 +0100 Subject: [PATCH] Add the possibility to define an armor stand name as invisible --- .../java/com/gmail/St3venAU/plugins/ArmorStandTools/AST.java | 5 +++-- src/main/resources/language.yml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/St3venAU/plugins/ArmorStandTools/AST.java b/src/main/java/com/gmail/St3venAU/plugins/ArmorStandTools/AST.java index 4c1bfca..6f8d023 100644 --- a/src/main/java/com/gmail/St3venAU/plugins/ArmorStandTools/AST.java +++ b/src/main/java/com/gmail/St3venAU/plugins/ArmorStandTools/AST.java @@ -362,8 +362,9 @@ public class AST extends JavaPlugin { if(input.equals("&")) input = ""; if(name) { if (input.length() > 0) { - as.setCustomName(input); - as.setCustomNameVisible(true); + boolean customNameVisibility = input.charAt(0) != '!'; + as.setCustomName(customNameVisibility ? input : input.substring(1)); + as.setCustomNameVisible(customNameVisibility); p.sendMessage(ChatColor.GREEN + Config.nameSet); } else { as.setCustomName(""); diff --git a/src/main/resources/language.yml b/src/main/resources/language.yml index 8f9079c..573ba92 100644 --- a/src/main/resources/language.yml +++ b/src/main/resources/language.yml @@ -104,7 +104,7 @@ removeACmd: 'Remove a command' cmdHelp: 'This command is used to add/remove commands to the nearest armor stand (within 4 blocks). The commands are executed when the armor stand is right clicked, lowest priority first.' #New since v4.4.0 enterName: 'Enter armor stand name in chat' -enterName2: 'Enter armor stand name in chat, or to remove the name enter:' +enterName2: 'Enter armor stand name in chat, with a "!" at the beginning to make the name invisible, or to remove the name enter:' enterSkull: 'Enter username for armor stand skull in chat' inputTimeout: 'Input timeout. Please try again.' nameSet: 'Armor stand name set'