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:
parent
b1f29e0f72
commit
c2919ab580
@ -35,7 +35,7 @@ execute as @e[type=#armor_statues:interactable,type=!minecraft:armor_stand,tag=a
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
@ -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 [\
|
||||
{\
|
||||
"text":"Delete unused invisible stands",\
|
||||
|
@ -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
|
@ -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
|
@ -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
|
@ -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 #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 #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
|
||||
#
|
||||
|
@ -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.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 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
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user