mirror of
https://github.com/LZStealth/armor-statues.git
synced 2025-08-10 08:35:52 +01:00
Initial commit for armor statues
This commit is contained in:
23
data/armor_statues/functions/trigger/lock.mcfunction
Normal file
23
data/armor_statues/functions/trigger/lock.mcfunction
Normal file
@@ -0,0 +1,23 @@
|
||||
#
|
||||
# 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
|
Reference in New Issue
Block a user