1
0
mirror of https://github.com/LZStealth/armor-statues.git synced 2025-06-07 17:16:44 +01:00

Added admin settings for copy/pasting CustomNameVisible and CustomName

This commit is contained in:
MukiTanuki 2024-08-03 00:37:11 -06:00
parent b1f29e0f72
commit c2919ab580
7 changed files with 228 additions and 1 deletions

View File

@ -35,7 +35,7 @@ execute as @e[type=#armor_statues:interactable,type=!minecraft:armor_stand,tag=a
# #
# turns armor stands with names visible # turns armor stands with names visible
# #
execute as @e[type=minecraft:armor_stand,nbt=!{CustomNameVisible:1b}, nbt=!{Marker:1b}, nbt=!{Invulnerable:1b}] if data entity @s CustomName run data merge entity @s {CustomNameVisible:1b} execute if score #auto_name_visible as_angle matches 1.. as @e[type=minecraft:armor_stand,nbt=!{CustomNameVisible:1b}, nbt=!{Marker:1b}, nbt=!{Invulnerable:1b}] if data entity @s CustomName run data merge entity @s {CustomNameVisible:1b}
# #
# re-enables triggers # re-enables triggers
# #

View File

@ -444,6 +444,137 @@ execute if score #wands_disabled as_angle matches 1 run tellraw @s [\
}\ }\
] ]
# #
# Save CustomNameVisible with copy/paste
#
execute if score #cnv_enabled as_angle matches 0 run tellraw @s [\
{\
"text":"Enable copy/paste value of CustomNameVisible: ",\
"color":"aqua"\
},\
{\
"text": "Disabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/customnamevisible_enabled_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #cnv_enabled as_angle matches 1 run tellraw @s [\
{\
"text":"Enable copy/paste value of CustomNameVisible: ",\
"color":"aqua"\
},\
{\
"text": "Enabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/customnamevisible_enabled_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
# Save Name with copy/paste
execute if score #name_enabled as_angle matches 0 run tellraw @s [\
{\
"text":"Enable copy/paste for armor stand Name: ",\
"color":"aqua"\
},\
{\
"text": "Disabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/name_enabled_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #name_enabled as_angle matches 1 run tellraw @s [\
{\
"text":"Enable copy/paste for armor stand Name: ",\
"color":"aqua"\
},\
{\
"text": "Enabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/name_enabled_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
# Disable auto visible name
execute if score #auto_name_visible as_angle matches 0 run tellraw @s [\
{\
"text":"Disable auto visible name: ",\
"color":"aqua"\
},\
{\
"text": "Disabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/auto_name_visible_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
execute if score #auto_name_visible as_angle matches 1 run tellraw @s [\
{\
"text":"Disable auto visible name: ",\
"color":"aqua"\
},\
{\
"text": "Enabled",\
"color":"green", \
"clickEvent":{\
"action":"run_command", \
"value":"/function armor_statues:admin/auto_name_visible_toggle"\
}, \
"hoverEvent":{\
"action":"show_text", \
"contents":{\
"text":"Click to toggle", \
"color":"yellow"\
}\
}\
}\
]
#
tellraw @s [\ tellraw @s [\
{\ {\
"text":"Delete unused invisible stands",\ "text":"Delete unused invisible stands",\

View File

@ -0,0 +1,30 @@
#
# Description: Enables auto visible names for armor stands.
# Called by: armor_statues:admin via chat link
# Entity @s: player
#
scoreboard players set #as_success as_angle 0
scoreboard players operation #as_success as_angle = #auto_name_visible as_angle
execute if score #as_success as_angle matches 0 run scoreboard players set #auto_name_visible as_angle 1
execute if score #as_success as_angle matches 1 run scoreboard players set #auto_name_visible as_angle 0
#
execute if score #auto_name_visible as_angle matches 1 run tellraw @s [\
{\
"text":"Auto name visibility set to ",\
"color":"aqua"\
},\
{\
"text":"Enabled"\
}\
]
execute if score #auto_name_visible as_angle matches 0 run tellraw @s [\
{\
"text":"Auto name visibility set to ",\
"color":"aqua"\
},\
{\
"text":"Disabled"\
}\
]
#
function armor_statues:admin

View File

@ -0,0 +1,30 @@
#
# Description: Enables copy/paste of CustomNameVisible
# Called by: armor_statues:admin via chat link
# Entity @s: player
#
scoreboard players set #as_success as_angle 0
scoreboard players operation #as_success as_angle = #cnv_enabled as_angle
execute if score #as_success as_angle matches 0 run scoreboard players set #cnv_enabled as_angle 1
execute if score #as_success as_angle matches 1 run scoreboard players set #cnv_enabled as_angle 0
#
execute if score #cnv_enabled as_angle matches 1 run tellraw @s [\
{\
"text":"Copy/Pasting of value CustomNameVisible has been set to ",\
"color":"aqua"\
},\
{\
"text":"Enabled"\
}\
]
execute if score #cnv_enabled as_angle matches 0 run tellraw @s [\
{\
"text":"Copy/Pasting of value CustomNameVisible has been set to ",\
"color":"aqua"\
},\
{\
"text":"Disabled"\
}\
]
#
function armor_statues:admin

View File

@ -0,0 +1,30 @@
#
# Description: Enables copy/paste of armor stand Name
# Called by: armor_statues:admin via chat link
# Entity @s: player
#
scoreboard players set #as_success as_angle 0
scoreboard players operation #as_success as_angle = #name_enabled as_angle
execute if score #as_success as_angle matches 0 run scoreboard players set #name_enabled as_angle 1
execute if score #as_success as_angle matches 1 run scoreboard players set #name_enabled as_angle 0
#
execute if score #name_enabled as_angle matches 1 run tellraw @s [\
{\
"text":"Copy/Pasting of armor stand Name has been set to ",\
"color":"aqua"\
},\
{\
"text":"Enabled"\
}\
]
execute if score #name_enabled as_angle matches 0 run tellraw @s [\
{\
"text":"Copy/Pasting of armor stand Name has been set to ",\
"color":"aqua"\
},\
{\
"text":"Disabled"\
}\
]
#
function armor_statues:admin

View File

@ -61,6 +61,9 @@ execute unless score #pointer_triggerable as_angle matches 0..1 run scoreboard p
execute unless score #adjustment_triggerable as_angle matches 0..1 run scoreboard players set #adjustment_triggerable as_angle 0 execute unless score #adjustment_triggerable as_angle matches 0..1 run scoreboard players set #adjustment_triggerable as_angle 0
execute unless score #scale_min as_angle matches 63..1000 run scoreboard players set #scale_min as_angle 250 execute unless score #scale_min as_angle matches 63..1000 run scoreboard players set #scale_min as_angle 250
execute unless score #scale_max as_angle matches 1000..16000 run scoreboard players set #scale_max as_angle 3000 execute unless score #scale_max as_angle matches 1000..16000 run scoreboard players set #scale_max as_angle 3000
execute unless score #cnv_enabled as_angle matches 0..1 run scoreboard players set #cnv_enabled as_angle 0
execute unless score #name_enabled as_angle matches 0..1 run scoreboard players set #name_enabled as_angle 0
execute unless score #auto_name_visible as_angle matches 0..1 run scoreboard players set #auto_name_visible as_angle 1
# #
# Legacy settings # Legacy settings
# #

View File

@ -14,6 +14,9 @@ data modify storage armor_statues:book_storage SavedItem.components.minecraft:cu
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.Invisible set from entity @s Invisible data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.Invisible set from entity @s Invisible
data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.HasVisualFire set from entity @s HasVisualFire data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.HasVisualFire set from entity @s HasVisualFire
execute store result storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.Scale double 0.001 run attribute @s minecraft:generic.scale get 1000 execute store result storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.Scale double 0.001 run attribute @s minecraft:generic.scale get 1000
execute if score #cnv_enabled as_angle matches 1.. run data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.CustomNameVisible set value 0
execute if score #cnv_enabled as_angle matches 1.. run data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.CustomNameVisible set from entity @s CustomNameVisible
execute if score #name_enabled as_angle matches 1.. run data modify storage armor_statues:book_storage SavedItem.components.minecraft:custom_data.SavedPose.CustomName set from entity @s CustomName
# #
execute as @p[tag=as_selected] run function armor_statues:storage_out execute as @p[tag=as_selected] run function armor_statues:storage_out
# #