1
0
mirror of https://github.com/LZStealth/armor-statues.git synced 2025-06-07 05:06:45 +01:00
2021-04-17 12:07:53 +02:00

24 lines
1.8 KiB
MCFunction

#
# Description: Apply or remove as_sealed and/or as_locked tags
# Called by: armor_statues:trigger
# Entity @s: Player
#
# Locking prevents the book from being used to modify the stand and disables the equipment slots to prevent accidental interaction
#
execute if entity @s[scores={as_trigger=1000}] as @e[type=armor_stand,tag=as_selected] run function armor_statues:locking/lock
#
# Unlocking
#
# creative player
execute if entity @s[scores={as_trigger=1001},gamemode=creative] as @e[type=armor_stand,distance=..3,tag=as_locked,tag=!as_sealed,sort=nearest,limit=1,nbt=!{Marker:1b},nbt=!{Invulnerable:1b}] run function armor_statues:locking/unlock
# UUID lock disabled
execute if data storage customizable_armor_stands:settings as_admin{uuid_lock:"Disabled"} if entity @s[scores={as_trigger=1001},gamemode=survival] as @e[type=armor_stand,distance=..3,tag=as_locked,tag=!as_sealed,sort=nearest,limit=1,nbt=!{Marker:1b},nbt=!{Invulnerable:1b}] run function armor_statues:locking/unlock
# UUID lock enabled
execute if data storage customizable_armor_stands:settings as_admin{uuid_lock:"Enabled"} if entity @s[scores={as_trigger=1001},gamemode=survival] as @e[type=armor_stand,distance=..3,tag=as_locked,tag=!as_sealed,sort=nearest,limit=1,nbt=!{Marker:1b},nbt=!{Invulnerable:1b}] run function armor_statues:locking/lock_check
#
# Sealing can only be used in creative mode and makes the armor stand invulnerable as well as locking it
#
execute if entity @s[scores={as_trigger=1002},gamemode=creative] if entity @e[type=armor_stand,distance=..3,tag=!as_sealed,sort=nearest,limit=1] run function armor_statues:sealing/seal
#
execute if entity @s[scores={as_trigger=1003},gamemode=creative] if entity @e[type=armor_stand,distance=..3,tag=as_sealed,sort=nearest,limit=1] run function armor_statues:sealing/seal