diff --git a/1_21_0/data/armor_statues/function/3_second.mcfunction b/1_21_0/data/armor_statues/function/3_second.mcfunction index e5389db..075ab99 100644 --- a/1_21_0/data/armor_statues/function/3_second.mcfunction +++ b/1_21_0/data/armor_statues/function/3_second.mcfunction @@ -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 # diff --git a/1_21_0/data/armor_statues/function/admin.mcfunction b/1_21_0/data/armor_statues/function/admin.mcfunction index 896f224..e28830b 100644 --- a/1_21_0/data/armor_statues/function/admin.mcfunction +++ b/1_21_0/data/armor_statues/function/admin.mcfunction @@ -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",\ diff --git a/1_21_0/data/armor_statues/function/admin/auto_name_visible_toggle.mcfunction b/1_21_0/data/armor_statues/function/admin/auto_name_visible_toggle.mcfunction new file mode 100644 index 0000000..23270dd --- /dev/null +++ b/1_21_0/data/armor_statues/function/admin/auto_name_visible_toggle.mcfunction @@ -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 diff --git a/1_21_0/data/armor_statues/function/admin/customnamevisible_enabled_toggle.mcfunction b/1_21_0/data/armor_statues/function/admin/customnamevisible_enabled_toggle.mcfunction new file mode 100644 index 0000000..62add52 --- /dev/null +++ b/1_21_0/data/armor_statues/function/admin/customnamevisible_enabled_toggle.mcfunction @@ -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 diff --git a/1_21_0/data/armor_statues/function/admin/name_enabled_toggle.mcfunction b/1_21_0/data/armor_statues/function/admin/name_enabled_toggle.mcfunction new file mode 100644 index 0000000..5784b7b --- /dev/null +++ b/1_21_0/data/armor_statues/function/admin/name_enabled_toggle.mcfunction @@ -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 diff --git a/1_21_0/data/armor_statues/function/load.mcfunction b/1_21_0/data/armor_statues/function/load.mcfunction index dd89b4a..be84b1b 100644 --- a/1_21_0/data/armor_statues/function/load.mcfunction +++ b/1_21_0/data/armor_statues/function/load.mcfunction @@ -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 # diff --git a/1_21_0/data/armor_statues/function/trigger/copy.mcfunction b/1_21_0/data/armor_statues/function/trigger/copy.mcfunction index 2091e98..e6d0cdb 100644 --- a/1_21_0/data/armor_statues/function/trigger/copy.mcfunction +++ b/1_21_0/data/armor_statues/function/trigger/copy.mcfunction @@ -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 #