mirror of
https://github.com/LZStealth/armor-statues.git
synced 2025-06-07 05:06:45 +01:00
Invisible armor stands will now become visible after a few seconds if they have no items, visible name, or aren't locked. Tool rack armor stands will now become visible after a few seconds if tripwire hook is broken.
This commit is contained in:
parent
04b957dbcf
commit
00df793299
@ -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
|
@ -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":"<Stick_God> 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
|
||||
#
|
||||
|
8
data/armor_statues/functions/remove_tool_rack.mcfunction
Normal file
8
data/armor_statues/functions/remove_tool_rack.mcfunction
Normal file
@ -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
|
7
data/armor_statues/functions/set_visible.mcfunction
Normal file
7
data/armor_statues/functions/set_visible.mcfunction
Normal file
@ -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
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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}
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user