diff --git a/data/armor_statues/functions/3_second.mcfunction b/data/armor_statues/functions/3_second.mcfunction index d3cb6ef..9a5de26 100644 --- a/data/armor_statues/functions/3_second.mcfunction +++ b/data/armor_statues/functions/3_second.mcfunction @@ -10,3 +10,12 @@ schedule function armor_statues:3_second 3s execute if score #animate_trigger as_angle matches 1.. as @e[type=#armor_statues:item_frames,tag=!as_animatable,predicate=armor_statues:item_frame_with_book] run tag @s add as_animatable # Untags execute if score #animate_trigger as_angle matches 1.. as @e[type=#armor_statues:item_frames,tag=as_animatable,predicate=!armor_statues:item_frame_with_book] run tag @s remove as_animatable +# +# Turns invisible armor stands visible if they don't have any items, customNameVisible, aren't locked, are markers, or invulnerable +# +execute as @e[type=minecraft:armor_stand, tag=as_invisible, nbt={Invisible:1b}, nbt=!{Invulnerable:1b}, nbt=!{Marker:1b}, nbt=!{HandItems:[ {Count:1b} ]}, nbt=!{ArmorItems:[ {Count:1b} ]}, nbt=!{CustomNameVisible:1b}, tag=!as_locked] run function armor_statues:set_visible +# +# Unlocks tool rack armor stands if the tripwire hook is broken +# +execute as @e[type=minecraft:armor_stand, tag=as_tool_rack, nbt=!{Small:1b}] at @s unless block ~ ~1 ~ minecraft:tripwire_hook run function armor_statues:remove_tool_rack +execute as @e[type=minecraft:armor_stand, tag=as_tool_rack, nbt={Small:1b}] at @s anchored eyes unless block ^ ^ ^ minecraft:tripwire_hook run function armor_statues:remove_tool_rack \ No newline at end of file diff --git a/data/armor_statues/functions/locking/unlock.mcfunction b/data/armor_statues/functions/locking/unlock.mcfunction index fc093e9..cae5871 100644 --- a/data/armor_statues/functions/locking/unlock.mcfunction +++ b/data/armor_statues/functions/locking/unlock.mcfunction @@ -5,9 +5,11 @@ # execute as @p[tag=as_selected,tag=!as_chat] run title @s actionbar {"text":"Armor stand unlocked","color":"dark_green"} execute as @p[tag=as_selected,tag=as_chat] run tellraw @s {"text":" Armor stand unlocked","color":"dark_green"} -effect give @s minecraft:glowing 1 +execute if entity @p[tag=as_selected] run effect give @s minecraft:glowing 1 data merge entity @s {DisabledSlots:0} tag @s remove as_locked +# removes tag for tool rack if present +tag @s[tag=as_tool_rack] remove as_tool_rack # # add Player UUID lock # diff --git a/data/armor_statues/functions/remove_tool_rack.mcfunction b/data/armor_statues/functions/remove_tool_rack.mcfunction new file mode 100644 index 0000000..ba0e10a --- /dev/null +++ b/data/armor_statues/functions/remove_tool_rack.mcfunction @@ -0,0 +1,8 @@ +# +# Description: Unlocks tool rack if tripwire hook isn't present +# Called by: armor_statues:3_second +# Entity @s: armor stand +# +# unlocks +# +function armor_statues:locking/unlock diff --git a/data/armor_statues/functions/set_visible.mcfunction b/data/armor_statues/functions/set_visible.mcfunction new file mode 100644 index 0000000..5b6d43b --- /dev/null +++ b/data/armor_statues/functions/set_visible.mcfunction @@ -0,0 +1,7 @@ +# +# Description: Sets invisible armor stands to visible +# Called by: armor_statues:3_second +# Entity @s: armor stand +# +data merge entity @s {Invisible:0b} +tag @s remove as_invisible \ No newline at end of file diff --git a/data/armor_statues/functions/trigger/align.mcfunction b/data/armor_statues/functions/trigger/align.mcfunction index 61a0c98..2601109 100644 --- a/data/armor_statues/functions/trigger/align.mcfunction +++ b/data/armor_statues/functions/trigger/align.mcfunction @@ -23,6 +23,7 @@ execute if entity @s[scores={as_trigger=153}] at @s run tp @s ^0.385 ^-0.78 ^-0. execute if entity @s[scores={as_trigger=154}] run data merge entity @s {ShowArms:1b,NoGravity:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-10.0f,0.0f,-90.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}} execute if entity @s[scores={as_trigger=154}] at @s run tp @s ^-0.17 ^-1.285 ^-0.44 # -# Tag the armor stand as modified +# Tag the armor stand as modified and invisible # +tag @s add as_invisible tag @s add as_modified diff --git a/data/armor_statues/functions/trigger/align_small.mcfunction b/data/armor_statues/functions/trigger/align_small.mcfunction index 5e734be..5f394d9 100644 --- a/data/armor_statues/functions/trigger/align_small.mcfunction +++ b/data/armor_statues/functions/trigger/align_small.mcfunction @@ -23,6 +23,7 @@ execute if entity @s[scores={as_trigger=153}] at @s run tp @s ^0.1925 ^-0.39 ^-0 execute if entity @s[scores={as_trigger=154}] run data merge entity @s {ShowArms:1b,NoGravity:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-10.0f,0.0f,-90.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}} execute if entity @s[scores={as_trigger=154}] at @s run tp @s ^-0.085 ^-0.6425 ^-0.22 # -# Tag the armor stand as modified +# Tag the armor stand as modified and invisible # +tag @s add as_invisible tag @s add as_modified diff --git a/data/armor_statues/functions/trigger/rack.mcfunction b/data/armor_statues/functions/trigger/rack.mcfunction index 13d5a77..fc31e3c 100644 --- a/data/armor_statues/functions/trigger/rack.mcfunction +++ b/data/armor_statues/functions/trigger/rack.mcfunction @@ -49,6 +49,11 @@ execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid4 run data get entity @p[tag=as_selected] UUID[3] execute if entity @s[tag=as_rack] run tag @s add as_uuid_locked # +# add tool rack tag +# +execute if entity @s[tag=as_rack] run tag @s add as_tool_rack +execute if entity @s[tag=as_rack] run tag @s add as_invisible +# # Finally, remove the as_rack tag # execute if entity @s[tag=as_rack] run tag @s remove as_rack diff --git a/data/armor_statues/functions/trigger/rack_small.mcfunction b/data/armor_statues/functions/trigger/rack_small.mcfunction index 3d669ac..cdbce1e 100644 --- a/data/armor_statues/functions/trigger/rack_small.mcfunction +++ b/data/armor_statues/functions/trigger/rack_small.mcfunction @@ -49,6 +49,11 @@ execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid4 run data get entity @p[tag=as_selected] UUID[3] execute if entity @s[tag=as_rack] run tag @s add as_uuid_locked # +# add tool rack tag +# +execute if entity @s[tag=as_rack] run tag @s add as_tool_rack +execute if entity @s[tag=as_rack] run tag @s add as_invisible +# # Finally, remove the as_rack tag # execute if entity @s[tag=as_rack] run tag @s remove as_rack diff --git a/data/armor_statues/functions/trigger/settings.mcfunction b/data/armor_statues/functions/trigger/settings.mcfunction index 963b7ac..14580bb 100644 --- a/data/armor_statues/functions/trigger/settings.mcfunction +++ b/data/armor_statues/functions/trigger/settings.mcfunction @@ -12,7 +12,9 @@ execute if entity @s[scores={as_trigger=6}] run data merge entity @s {Small:0b} execute if entity @s[scores={as_trigger=7}] run data merge entity @s {NoGravity:0b} execute if entity @s[scores={as_trigger=8}] run data merge entity @s {NoGravity:1b} execute if entity @s[scores={as_trigger=9}] run data merge entity @s {Invisible:0b} +execute if entity @s[scores={as_trigger=9}] run tag @s remove as_invisible execute if entity @s[scores={as_trigger=10}] run data merge entity @s {Invisible:1b} +execute if entity @s[scores={as_trigger=10}] run tag @s add as_invisible execute if entity @s[scores={as_trigger=11}] run data merge entity @s {CustomNameVisible:1b} execute if entity @s[scores={as_trigger=12}] run data merge entity @s {CustomNameVisible:0b} #