├── pack.png ├── data ├── minecraft │ └── tags │ │ └── functions │ │ ├── tick.json │ │ └── load.json └── armor_statues │ ├── predicates │ ├── random_chance_10.json │ ├── random_chance_15.json │ ├── random_chance_20.json │ ├── random_chance_30.json │ ├── random_chance_40.json │ ├── random_chance_50.json │ ├── random_chance_70.json │ ├── random_chance_85.json │ ├── savedpose_offhand.json │ ├── savedpose_mainhand.json │ ├── savedpose.json │ ├── item_frame_with_book.json │ ├── bothhands.json │ ├── book.json │ ├── offhand_potion.json │ └── mainhand_potion.json │ ├── tags │ ├── items │ │ └── potions.json │ └── entity_types │ │ └── item_frames.json │ ├── functions │ ├── help │ │ ├── get_book.mcfunction │ │ ├── chat_actionbar_toggle.mcfunction │ │ ├── credits.mcfunction │ │ └── main.mcfunction │ ├── set_visible.mcfunction │ ├── remove_tool_rack.mcfunction │ ├── item_frames │ │ ├── visible.mcfunction │ │ ├── invisible.mcfunction │ │ ├── invisible_old.mcfunction │ │ └── fixed.mcfunction │ ├── craft_book.mcfunction │ ├── locking │ │ ├── lock_check.mcfunction │ │ ├── unlock.mcfunction │ │ ├── lock.mcfunction │ │ └── uuid_check.mcfunction │ ├── shrine │ │ ├── main.mcfunction │ │ ├── remove.mcfunction │ │ └── create.mcfunction │ ├── uninstall.mcfunction │ ├── replace_book.mcfunction │ ├── animate.mcfunction │ ├── repeat_trigger.mcfunction │ ├── trigger │ │ ├── last_edit.mcfunction │ │ ├── paste.mcfunction │ │ ├── facing.mcfunction │ │ ├── slots.mcfunction │ │ ├── rotation.mcfunction │ │ ├── copy.mcfunction │ │ ├── random_pose.mcfunction │ │ ├── lock.mcfunction │ │ ├── align.mcfunction │ │ ├── align_small.mcfunction │ │ ├── settings.mcfunction │ │ ├── position.mcfunction │ │ ├── position_relative.mcfunction │ │ ├── flip.mcfunction │ │ ├── mirror.mcfunction │ │ ├── rack.mcfunction │ │ ├── rack_small.mcfunction │ │ ├── presets.mcfunction │ │ ├── pointing.mcfunction │ │ ├── pointing_small.mcfunction │ │ └── adjust.mcfunction │ ├── animate_time.mcfunction │ ├── storage_out.mcfunction │ ├── admin │ │ ├── uuid_lock_toggle.mcfunction │ │ ├── craft_book_toggle.mcfunction │ │ ├── book_from_help_toggle.mcfunction │ │ ├── fixed_item_frame_toggle.mcfunction │ │ ├── unused.mcfunction │ │ └── marker.mcfunction │ ├── help.mcfunction │ ├── randomizer │ │ ├── left_arm.mcfunction │ │ ├── right_arm.mcfunction │ │ ├── body.mcfunction │ │ ├── head.mcfunction │ │ ├── left_leg.mcfunction │ │ ├── right_leg.mcfunction │ │ ├── body_angle.mcfunction │ │ ├── head_angle.mcfunction │ │ ├── left_leg_angle.mcfunction │ │ └── right_leg_angle.mcfunction │ ├── storage_in.mcfunction │ ├── repeat │ │ ├── save.mcfunction │ │ ├── redo.mcfunction │ │ ├── undo.mcfunction │ │ ├── save_state.mcfunction │ │ ├── save_redo_state.mcfunction │ │ ├── save_undo_state.mcfunction │ │ └── undo_redo.mcfunction │ ├── give.mcfunction │ ├── tick.mcfunction │ ├── sealing │ │ ├── seal.mcfunction │ │ └── unseal.mcfunction │ ├── bugfix.mcfunction │ ├── second.mcfunction │ ├── relative_position_aligned_nudge.mcfunction │ ├── enable.mcfunction │ ├── 3_second.mcfunction │ ├── storage_out_copy.mcfunction │ ├── relative_position_nudge.mcfunction │ ├── load.mcfunction │ ├── if_trigger.mcfunction │ ├── admin.mcfunction │ └── trigger.mcfunction │ ├── advancements │ ├── root.json │ ├── enable.json │ ├── crafting.json │ └── armor_statues.json │ ├── item_modifiers │ └── storage_out.json │ └── loot_tables │ ├── replace.json │ ├── replace_save.json │ ├── random_pose.json │ └── book_old.json ├── pack.mcmeta ├── .github └── ISSUE_TEMPLATE │ └── bug_report.md ├── pack.info └── README.md /pack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MukiTanuki/armor-statues/HEAD/pack.png -------------------------------------------------------------------------------- /data/minecraft/tags/functions/tick.json: -------------------------------------------------------------------------------- 1 | { 2 | "values": [ 3 | "armor_statues:tick" 4 | ] 5 | } -------------------------------------------------------------------------------- /data/armor_statues/predicates/random_chance_10.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:random_chance", 3 | "chance": 0.15 4 | } -------------------------------------------------------------------------------- /data/armor_statues/predicates/random_chance_15.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:random_chance", 3 | "chance": 0.15 4 | } -------------------------------------------------------------------------------- /data/armor_statues/predicates/random_chance_20.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:random_chance", 3 | "chance": 0.2 4 | } -------------------------------------------------------------------------------- /data/armor_statues/predicates/random_chance_30.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:random_chance", 3 | "chance": 0.3 4 | } -------------------------------------------------------------------------------- /data/armor_statues/predicates/random_chance_40.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:random_chance", 3 | "chance": 0.4 4 | } -------------------------------------------------------------------------------- /data/armor_statues/predicates/random_chance_50.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:random_chance", 3 | "chance": 0.50 4 | } -------------------------------------------------------------------------------- /data/armor_statues/predicates/random_chance_70.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:random_chance", 3 | "chance": 0.70 4 | } -------------------------------------------------------------------------------- /data/armor_statues/predicates/random_chance_85.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:random_chance", 3 | "chance": 0.85 4 | } -------------------------------------------------------------------------------- /data/minecraft/tags/functions/load.json: -------------------------------------------------------------------------------- 1 | { 2 | "values": [ 3 | "armor_statues:load", 4 | "armor_statues:second", 5 | "armor_statues:3_second" 6 | ] 7 | } -------------------------------------------------------------------------------- /pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "pack_format": 7, 4 | "description": [{"text":"Armor Statues","color":"gold"},{"text":"\n","color":"yellow"}] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /data/armor_statues/tags/items/potions.json: -------------------------------------------------------------------------------- 1 | { 2 | "values": [ 3 | "minecraft:potion", 4 | "minecraft:splash_potion", 5 | "minecraft:lingering_potion" 6 | ] 7 | } -------------------------------------------------------------------------------- /data/armor_statues/functions/help/get_book.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Get book via chat link 3 | # Called by: armor_statues:help 4 | # Entity @s: Player 5 | # 6 | function armor_statues:give 7 | -------------------------------------------------------------------------------- /data/armor_statues/advancements/root.json: -------------------------------------------------------------------------------- 1 | { 2 | "criteria": { 3 | "impossible": { 4 | "trigger": "minecraft:impossible" 5 | } 6 | }, 7 | "requirements": [ 8 | [ 9 | "impossible" 10 | ] 11 | ] 12 | } -------------------------------------------------------------------------------- /data/armor_statues/functions/set_visible.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Sets invisible armor stands to visible 3 | # Called by: armor_statues:3_second 4 | # Entity @s: armor stand 5 | # 6 | data merge entity @s {Invisible:0b} 7 | tag @s remove as_invisible -------------------------------------------------------------------------------- /data/armor_statues/functions/remove_tool_rack.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Unlocks tool rack if tripwire hook isn't present 3 | # Called by: armor_statues:3_second 4 | # Entity @s: armor stand 5 | # 6 | # unlocks 7 | # 8 | function armor_statues:locking/unlock 9 | -------------------------------------------------------------------------------- /data/armor_statues/tags/entity_types/item_frames.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": "false", 3 | "values": [ 4 | { 5 | "id": "minecraft:item_frame", 6 | "required": "true" 7 | }, 8 | { 9 | "id": "minecraft:glow_item_frame", 10 | "required": "true" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /data/armor_statues/functions/item_frames/visible.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: turns empty item frames visible 3 | # Called by: armor_statues:as_second 4 | # Entity @s: invisible item frame 5 | # 6 | execute as @s run data merge entity @s {Invisible:0b} 7 | execute as @s run tag @s remove if_invisible -------------------------------------------------------------------------------- /data/armor_statues/functions/item_frames/invisible.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: turns item frame invisible if successful 3 | # Called by: armor_statues:if_trigger 4 | # Entity @s: #item frame 5 | # 6 | # Makes item frame invisible 7 | # 8 | data merge entity @s {Invisible:1b} 9 | tag @s add if_invisible 10 | -------------------------------------------------------------------------------- /data/armor_statues/predicates/savedpose_offhand.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:entity_properties", 3 | "entity": "this", 4 | "predicate": { 5 | "equipment": { 6 | "offhand": { 7 | "item": "minecraft:written_book", 8 | "nbt": "{datapack:ArmorStatuesV2, SavedPose:{} }" 9 | } 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /data/armor_statues/predicates/savedpose_mainhand.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:entity_properties", 3 | "entity": "this", 4 | "predicate": { 5 | "equipment": { 6 | "mainhand": { 7 | "item": "minecraft:written_book", 8 | "nbt": "{datapack:ArmorStatuesV2, SavedPose:{} }" 9 | } 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /data/armor_statues/predicates/savedpose.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:alternative", 3 | "terms": [ 4 | { 5 | "condition": "minecraft:reference", 6 | "name": "armor_statues:savedpose_mainhand" 7 | }, 8 | { 9 | "condition": "minecraft:reference", 10 | "name": "armor_statues:savedpose_offhand" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /data/armor_statues/functions/craft_book.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Replace titled book with proper command book 3 | # Called by: advancement armor_statues:crafting 4 | # Entity @s: Player 5 | # 6 | # Tags the player to replace crafting book 7 | # 8 | execute if data storage customizable_armor_stands:settings as_admin{book_craft:"Enabled"} run tag @s add as_craft -------------------------------------------------------------------------------- /data/armor_statues/functions/locking/lock_check.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Checks if armor stand has old or new lock 3 | # Called by: armor_statues:trigger/trigger/lock 4 | # Entity @s: Player 5 | # 6 | execute if entity @s[tag=as_locked,tag=as_uuid_locked] run function armor_statues:locking/uuid_check 7 | execute if entity @s[tag=as_locked,tag=!as_uuid_locked] run function armor_statues:locking/unlock -------------------------------------------------------------------------------- /data/armor_statues/functions/shrine/main.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Display shrine particles and give book 3 | # Called by: armor_statues:tick 4 | # Entity @s: Shrine marker area effect cloud 5 | # 6 | # Give book to nearby players if they do not have it already 7 | # 8 | execute as @a[distance=..1.5,nbt=!{Inventory:[{id:"minecraft:written_book",tag:{datapack:"ArmorStatuesV2"}}]}] at @s run function armor_statues:give 9 | -------------------------------------------------------------------------------- /data/armor_statues/predicates/item_frame_with_book.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "condition": "minecraft:entity_properties", 4 | "entity": "this", 5 | "predicate": { 6 | "nbt": "{Item: {tag: {datapack:ArmorStatuesV2, SavedPose:{} }}}" 7 | } 8 | }, 9 | { 10 | "condition": "minecraft:location_check", 11 | "predicate": { 12 | "block": { 13 | "block": "minecraft:redstone_wire" 14 | } 15 | } 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /data/armor_statues/functions/uninstall.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Remove scoreboards 3 | # Called by: main:#uninstall 4 | # Entity @s: None 5 | # 6 | # Remove scoreboards 7 | # 8 | schedule clear armor_statues:tick 9 | schedule clear armor_statues:second 10 | 11 | scoreboard objectives remove as_trigger 12 | scoreboard objectives remove as_pose 13 | scoreboard objectives remove as_angle 14 | scoreboard objectives remove as_help 15 | -------------------------------------------------------------------------------- /data/armor_statues/predicates/bothhands.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:entity_properties", 3 | "entity": "this", 4 | "predicate": { 5 | "equipment": { 6 | "mainhand": { 7 | "item": "minecraft:written_book", 8 | "nbt": "{datapack:ArmorStatuesV2}" 9 | }, 10 | "offhand": { 11 | "item": "minecraft:written_book", 12 | "nbt": "{datapack:ArmorStatuesV2}" 13 | } 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /data/armor_statues/functions/replace_book.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Replace titled book with proper command book 3 | # Called by: armor_statues:tick 4 | # Entity @s: Player 5 | # 6 | # Replaces the written book from the players inventory 7 | # 8 | execute store result score #as_success as_help run clear @s minecraft:written_book{title:"Statues"} 1 9 | execute if score #as_success as_help matches 1.. run function armor_statues:give 10 | 11 | tag @s remove as_craft -------------------------------------------------------------------------------- /data/armor_statues/item_modifiers/storage_out.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "function": "minecraft:copy_nbt", 4 | "source": { 5 | "type": "storage", 6 | "source": "customizable_armor_stands:book_storage" 7 | }, 8 | "ops": [ 9 | { 10 | "source": "SavedItem.tag", 11 | "target": "{}", 12 | "op": "merge" 13 | }, 14 | { 15 | "source": "SavedItem.tag.SavedPose", 16 | "target": "SavedPose", 17 | "op": "replace" 18 | } 19 | ] 20 | } 21 | ] -------------------------------------------------------------------------------- /data/armor_statues/functions/animate.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Animate armor stands based off of item frames 3 | # Called by: armor_statues:tick 4 | # Entity @s: #item frames 5 | # 6 | tag @s add as_powered 7 | data modify entity @e[type=minecraft:armor_stand,distance=..8,tag=!as_locked,sort=nearest,limit=1,nbt=!{Marker:1b},nbt=!{Invulnerable:1b}] {} merge from entity @s Item.tag.SavedPose 8 | data modify entity @e[type=minecraft:armor_stand,distance=..8,tag=!as_locked,sort=nearest,limit=1,nbt=!{Marker:1b},nbt=!{Invulnerable:1b}] Pose set from entity @s Item.tag.SavedPose.Pose -------------------------------------------------------------------------------- /data/armor_statues/functions/repeat_trigger.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Applys the last repeated trigger score to players score 3 | # Called by: armor_statues:second 4 | # Entity @s: player 5 | # 6 | execute as @s run function armor_statues:storage_in 7 | # 8 | # Copies score from book to as_trigger 9 | # 10 | execute store result score @s as_trigger run data get storage customizable_armor_stands:book_storage SavedItem.tag.Repeat 11 | # 12 | # Reset player's trigger score and re-enable 13 | # 14 | scoreboard players set @s as_repeat 0 15 | scoreboard players enable @s as_repeat -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/last_edit.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Records UUID of the last editor of the armor stand 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor stand 5 | # 6 | execute store result score @s as_edited_uuid1 run data get entity @p[tag=as_selected] UUID[0] 7 | execute store result score @s as_edited_uuid2 run data get entity @p[tag=as_selected] UUID[1] 8 | execute store result score @s as_edited_uuid3 run data get entity @p[tag=as_selected] UUID[2] 9 | execute store result score @s as_edited_uuid4 run data get entity @p[tag=as_selected] UUID[3] -------------------------------------------------------------------------------- /data/armor_statues/functions/shrine/remove.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Remove marker area effect cloud 3 | # Called by: player 4 | # Entity @s: player 5 | # 6 | # If shrine AEC is within range, reset shrine coordinates 7 | # 8 | execute if entity @e[type=area_effect_cloud,tag=as_shrine,distance=..3] run scoreboard players reset #as_shrine_x as_help 9 | execute if entity @e[type=area_effect_cloud,tag=as_shrine,distance=..3] run scoreboard players reset #as_shrine_z as_help 10 | # 11 | # Remove AEC 12 | # 13 | kill @e[type=area_effect_cloud,tag=as_shrine,distance=..3,sort=nearest,limit=1] 14 | -------------------------------------------------------------------------------- /data/armor_statues/functions/help/chat_actionbar_toggle.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Send notifications to chat 3 | # Called by: armor_statues:help 4 | # Entity @s: Player 5 | # 6 | execute store success score #as_success as_help run tag @s add as_chat 7 | execute unless score #as_success as_help matches 1 run tag @s remove as_chat 8 | 9 | # 10 | execute if entity @s[tag=as_chat] run tellraw @s [{"text":"Notifications will be directed to chat","color":"aqua"}] 11 | execute if entity @s[tag=!as_chat] run tellraw @s [{"text":"Notifications will be directed to the action bar","color":"aqua"}] 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report something wrong with Armor Statues 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | #### Issue Description: 11 | 12 | 13 | 14 | #### What happens: 15 | 16 | 17 | 18 | #### What you expected to happen: 19 | 20 | 21 | 22 | #### Steps to reproduce: 23 | 24 | 1. 25 | 2. 26 | 3. 27 | ... 28 | 29 | ____ 30 | #### Affected Versions (Do *not* use "latest"): 31 | 32 | - Minecraft: 33 | - Armor Statues: 34 | 35 | - Single Player and/or Server? 36 | - Optifine? 37 | 38 | #### Screenshots *(Optional)* 39 | -------------------------------------------------------------------------------- /data/armor_statues/functions/animate_time.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Animate armor stands based off of item frames 3 | # Called by: armor_statues:tick 4 | # Entity @s: None 5 | # 6 | execute as @e[type=#armor_statues:item_frames,tag=as_animatable,tag=!as_powered] at @s if entity @p[distance=..35] if block ~ ~ ~ minecraft:redstone_wire unless block ~ ~ ~ minecraft:redstone_wire[power=0] run function armor_statues:animate 7 | execute as @e[type=#armor_statues:item_frames,tag=as_animatable,tag=as_powered] at @s if block ~ ~ ~ minecraft:redstone_wire[power=0] run tag @s remove as_powered 8 | scoreboard players set #animate_time as_angle 0 -------------------------------------------------------------------------------- /data/armor_statues/advancements/enable.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecraft:armor_stand" 5 | }, 6 | "title": { 7 | "text":"enable_as_trigger" 8 | }, 9 | "description": { 10 | "text":"" 11 | }, 12 | "frame": "task", 13 | "show_toast": false, 14 | "announce_to_chat": false, 15 | "hidden": false 16 | }, 17 | "parent": "armor_statues:root", 18 | "criteria": { 19 | "tick": { 20 | "trigger": "minecraft:tick" 21 | } 22 | }, 23 | "requirements": [ 24 | [ 25 | "tick" 26 | ] 27 | ], 28 | "rewards": { 29 | "function": "armor_statues:enable" 30 | } 31 | } -------------------------------------------------------------------------------- /data/armor_statues/functions/shrine/create.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Summon marker area effect cloud for shrine 3 | # Called by: player 4 | # Entity @s: player 5 | # 6 | # Summon AEC 7 | # 8 | execute align xyz run summon area_effect_cloud ~0.5 ~ ~0.5 {Duration:2147000000,Radius:0.0,Tags:["as_shrine"],Particle:"minecraft:underwater"} 9 | # 10 | # Store coordinates of shrine 11 | # 12 | execute store result score #as_shrine_x as_help run data get entity @e[type=minecraft:area_effect_cloud,tag=as_shrine,distance=..3,limit=1] Pos[0] 1 13 | execute store result score #as_shrine_z as_help run data get entity @e[type=minecraft:area_effect_cloud,tag=as_shrine,distance=..3,limit=1] Pos[2] 1 14 | -------------------------------------------------------------------------------- /data/armor_statues/functions/storage_out.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Copies stored book from storage into mainhand or offhand 3 | # Called by: as_statue:trigger\copy 4 | # Entity @s: player 5 | # 6 | # Copies data from storage to the players book 7 | # 8 | execute if entity @s[nbt={SelectedItem:{id:"minecraft:written_book", tag:{datapack:"ArmorStatuesV2"}}}] run item modify entity @s weapon.mainhand armor_statues:storage_out 9 | execute if entity @s[nbt={Inventory:[{id:"minecraft:written_book", Slot:-106b, tag:{datapack:"ArmorStatuesV2"}}]}] unless entity @s[nbt={SelectedItem:{id:"minecraft:written_book", tag:{datapack:"ArmorStatuesV2"}}}] run item modify entity @s weapon.offhand armor_statues:storage_out -------------------------------------------------------------------------------- /data/armor_statues/functions/admin/uuid_lock_toggle.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Enable option to make locking match player uuids 3 | # Called by: armor_statues:admin via chat link 4 | # Entity @s: player 5 | # 6 | execute store success score #as_success as_help run data modify storage customizable_armor_stands:settings as_admin.uuid_lock set value "Disabled" 7 | execute unless score #as_success as_help matches 1 run data modify storage customizable_armor_stands:settings as_admin.uuid_lock set value "Enabled" 8 | # 9 | tellraw @s [{"text":"UUID locking has been ","color":"aqua"},{"storage":"customizable_armor_stands:settings", "nbt":"as_admin.uuid_lock"}] 10 | # 11 | function armor_statues:admin 12 | -------------------------------------------------------------------------------- /data/armor_statues/functions/admin/craft_book_toggle.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Enable option to get the book by crafting 3 | # Called by: armor_statues:admin via chat link 4 | # Entity @s: player 5 | # 6 | execute store success score #as_success as_help run data modify storage customizable_armor_stands:settings as_admin.book_craft set value "Disabled" 7 | execute unless score #as_success as_help matches 1 run data modify storage customizable_armor_stands:settings as_admin.book_craft set value "Enabled" 8 | # 9 | tellraw @s [{"text":"Getting the book via crafting has been ","color":"aqua"},{"storage":"customizable_armor_stands:settings", "nbt":"as_admin.book_craft"}] 10 | # 11 | function armor_statues:admin 12 | -------------------------------------------------------------------------------- /data/armor_statues/functions/help.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Display help in chat 3 | # Called by: armor_statues:tick 4 | # Entity @s: player 5 | # 6 | execute if score @s as_help matches 2 if data storage customizable_armor_stands:settings as_admin{book_help:"Enabled"} run function armor_statues:help/get_book 7 | execute if score @s as_help matches 3 run function armor_statues:help/chat_actionbar_toggle 8 | execute if score @s as_help matches 4 run function armor_statues:help/credits 9 | execute if score @s as_help matches 1..3 unless score @s as_help matches 2 run function armor_statues:help/main 10 | # 11 | # Reset trigger score 12 | # 13 | scoreboard players set @s as_help 0 14 | scoreboard players enable @s as_help 15 | -------------------------------------------------------------------------------- /data/armor_statues/loot_tables/replace.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:entity", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:item", 9 | "name": "minecraft:written_book", 10 | "functions": [ 11 | { 12 | "function": "minecraft:copy_nbt", 13 | "source": "this", 14 | "ops": [ 15 | { 16 | "source": "HandItems[1].tag", 17 | "target": "{}", 18 | "op": "merge" 19 | } 20 | ] 21 | }, 22 | { 23 | "function": "minecraft:set_count", 24 | "count": 0 25 | }, 26 | { 27 | "function": "minecraft:looting_enchant", 28 | "count":1 29 | } 30 | ] 31 | } 32 | ] 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /data/armor_statues/functions/admin/book_from_help_toggle.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Disable option to get the book directly from the help menu 3 | # Called by: armor_statues:admin via chat link 4 | # Entity @s: player 5 | # 6 | execute store success score #as_success as_help run data modify storage customizable_armor_stands:settings as_admin.book_help set value "Disabled" 7 | execute unless score #as_success as_help matches 1 run data modify storage customizable_armor_stands:settings as_admin.book_help set value "Enabled" 8 | # 9 | tellraw @s [{"text":"Getting the book from the help menu has been ","color":"aqua"},{"storage":"customizable_armor_stands:settings", "nbt":"as_admin.book_help"}] 10 | # 11 | function armor_statues:admin -------------------------------------------------------------------------------- /data/armor_statues/predicates/book.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:alternative", 3 | "terms": [ 4 | { 5 | "condition": "minecraft:entity_properties", 6 | "entity": "this", 7 | "predicate": { 8 | "equipment": { 9 | "mainhand": { 10 | "item": "minecraft:written_book", 11 | "nbt": "{datapack:ArmorStatuesV2}" 12 | } 13 | } 14 | } 15 | }, 16 | { 17 | "condition": "minecraft:entity_properties", 18 | "entity": "this", 19 | "predicate": { 20 | "equipment": { 21 | "offhand": { 22 | "item": "minecraft:written_book", 23 | "nbt": "{datapack:ArmorStatuesV2}" 24 | } 25 | } 26 | } 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /data/armor_statues/functions/admin/fixed_item_frame_toggle.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Enable option to get allow item frame fixing from the book 3 | # Called by: armor_statues:admin via chat link 4 | # Entity @s: player 5 | # 6 | execute store success score #as_success as_help run data modify storage customizable_armor_stands:settings as_admin.fixed_item_frame set value "Disabled" 7 | execute unless score #as_success as_help matches 1 run data modify storage customizable_armor_stands:settings as_admin.fixed_item_frame set value "Enabled" 8 | # 9 | tellraw @s [{"text":"Fixing item frame option has been ","color":"aqua"},{"storage":"customizable_armor_stands:settings", "nbt":"as_admin.fixed_item_frame"}] 10 | # 11 | function armor_statues:admin 12 | -------------------------------------------------------------------------------- /data/armor_statues/functions/randomizer/left_arm.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Randomizes appendage rotation 3 | # Called by: armor_statues:trigger/random_pose 4 | # Entity @s: temp armor stand 5 | # 6 | execute store result storage customizable_armor_stands:pose_storage Pose.LeftArm[0] float 0.001 run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"left_arm_x" }].Amount 1000 7 | execute store result storage customizable_armor_stands:pose_storage Pose.LeftArm[1] float 0.001 run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"left_arm_y" }].Amount 1000 8 | execute store result storage customizable_armor_stands:pose_storage Pose.LeftArm[2] float 0.001 run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"left_arm_z" }].Amount 1000 -------------------------------------------------------------------------------- /data/armor_statues/functions/randomizer/right_arm.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Randomizes appendage rotation 3 | # Called by: armor_statues:trigger/random_pose 4 | # Entity @s: temp armor stand 5 | # 6 | execute store result storage customizable_armor_stands:pose_storage Pose.RightArm[0] float 0.001 run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"right_arm_x" }].Amount 1000 7 | execute store result storage customizable_armor_stands:pose_storage Pose.RightArm[1] float 0.001 run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"right_arm_y" }].Amount 1000 8 | execute store result storage customizable_armor_stands:pose_storage Pose.RightArm[2] float 0.001 run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"right_arm_z" }].Amount 1000 -------------------------------------------------------------------------------- /data/armor_statues/functions/storage_in.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Copies player book from mainhand or offhand into storage 3 | # Called by: as_statue:trigger\copy as_statue:trigger\paste 4 | # Entity @s: player 5 | # 6 | # Temp storage to copy 7 | # 8 | execute if entity @s[nbt={SelectedItem:{id:"minecraft:written_book", tag:{datapack:"ArmorStatuesV2"}}}] run data modify storage customizable_armor_stands:book_storage SavedItem set from entity @s SelectedItem 9 | execute if entity @s[nbt={Inventory:[{id:"minecraft:written_book", Slot:-106b, tag:{datapack:"ArmorStatuesV2" }}]}] unless entity @s[nbt={SelectedItem:{id:"minecraft:written_book", tag:{datapack:"ArmorStatuesV2"}}}] run data modify storage customizable_armor_stands:book_storage SavedItem set from entity @s Inventory[{Slot:-106b}] -------------------------------------------------------------------------------- /data/armor_statues/predicates/offhand_potion.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:alternative", 3 | "terms": [ 4 | { 5 | "condition": "minecraft:entity_properties", 6 | "entity": "this", 7 | "predicate": { 8 | "equipment": { 9 | "offhand": { 10 | "tag": "armor_statues:potions", 11 | "potion": "minecraft:invisibility" 12 | } 13 | } 14 | } 15 | }, 16 | { 17 | "condition": "minecraft:entity_properties", 18 | "entity": "this", 19 | "predicate": { 20 | "equipment": { 21 | "offhand": { 22 | "tag": "armor_statues:potions", 23 | "potion": "minecraft:long_invisibility" 24 | } 25 | } 26 | } 27 | } 28 | 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /data/armor_statues/functions/repeat/save.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Copies last function to book 3 | # Called by: as_statue:trigger 4 | # Entity @s: player 5 | # 6 | execute as @s run function armor_statues:storage_in 7 | # 8 | execute store result storage customizable_armor_stands:book_storage SavedItem.tag.Repeat int 1 run scoreboard players get @p[tag=as_selected] as_trigger 9 | # 10 | # Undo states 11 | # 12 | execute unless score @s as_trigger matches 1000..1004 unless score @s as_trigger matches 161..162 unless score @s as_trigger matches 120..123 unless score @s as_trigger matches 155 if entity @e[type=armor_stand,tag=as_selected] if score #undo_states as_angle matches 1.. run function armor_statues:repeat/save_state 13 | # 14 | execute as @s run function armor_statues:storage_out 15 | -------------------------------------------------------------------------------- /data/armor_statues/predicates/mainhand_potion.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:alternative", 3 | "terms": [ 4 | { 5 | "condition": "minecraft:entity_properties", 6 | "entity": "this", 7 | "predicate": { 8 | "equipment": { 9 | "mainhand": { 10 | "tag": "armor_statues:potions", 11 | "potion": "minecraft:invisibility" 12 | } 13 | } 14 | } 15 | }, 16 | { 17 | "condition": "minecraft:entity_properties", 18 | "entity": "this", 19 | "predicate": { 20 | "equipment": { 21 | "mainhand": { 22 | "tag": "armor_statues:potions", 23 | "potion": "minecraft:long_invisibility" 24 | } 25 | } 26 | } 27 | } 28 | 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /data/armor_statues/functions/give.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Issue control book 3 | # Called by: command block 4 | # Entity @s: player 5 | # 6 | # Trigger values in use are: 1-12 Style settings 7 | # 20-39 Pose presets 8 | # 40-51 Nudge position 9 | # 52-57 Adjust rotation 10 | # 60-95 Pose adjustment 11 | # 101-112 Nudge position 12 | # 120-123 Angle step 13 | # 124-125 Face towards or away 14 | # 131-135 Pose mirror and flip 15 | # 141-142 Pose presets 16 | # 151-155 Auto alignment 17 | # 161-162 Exchange Slots 18 | # 999 Check target 19 | # 1000-1003 Lock and seal 20 | # 1004-1005 Copy and paste 21 | # 22 | # Give control book 23 | # 24 | loot give @s loot armor_statues:book 25 | 26 | -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/paste.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Paste armor stand settings and pose from book 3 | # Called by: as_statue:trigger 4 | # Entity @s: armor stand 5 | # 6 | execute as @p[tag=as_selected] run function armor_statues:storage_in 7 | # 8 | data modify entity @s {} merge from storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose 9 | data modify entity @s Pose set from storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose.Pose 10 | # 11 | title @a[tag=as_selected,tag=!as_chat] actionbar {"text":"Settings and pose pasted from the book","color":"dark_green"} 12 | tellraw @a[tag=as_selected,tag=as_chat] {"text":" Settings and pose pasted from the book","color":"dark_green"} 13 | # 14 | # Tag the armor stand as modified 15 | # 16 | tag @s add as_modified 17 | -------------------------------------------------------------------------------- /data/armor_statues/advancements/crafting.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecraft:armor_stand" 5 | }, 6 | "title": { 7 | "text":"craft_book" 8 | }, 9 | "description": { 10 | "text":"" 11 | }, 12 | "frame": "task", 13 | "show_toast": false, 14 | "announce_to_chat": false, 15 | "hidden": false 16 | }, 17 | "parent": "armor_statues:root", 18 | "criteria": { 19 | "craft_book": { 20 | "trigger": "minecraft:inventory_changed", 21 | "conditions": { 22 | "items": [ 23 | { 24 | "item": "minecraft:written_book", 25 | "nbt": "{title:\"Statues\"}" 26 | } 27 | ] 28 | } 29 | } 30 | }, 31 | "requirements": [ 32 | [ 33 | "craft_book" 34 | ] 35 | ], 36 | "rewards": { 37 | "function": "armor_statues:craft_book" 38 | } 39 | } -------------------------------------------------------------------------------- /data/armor_statues/functions/tick.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Processing every tick 3 | # Called by: #main:tick 4 | # Entity @s: None 5 | # 6 | # Particle at shrine position 7 | # 8 | execute as @e[tag=as_shrine] at @s run particle minecraft:enchant ~ ~ ~ 0.5 0.5 0.5 0.25 5 9 | # 10 | # If book crafting is enabled, check for players holding a written book titled "Statues" 11 | # 12 | execute as @a[tag=as_craft] run function armor_statues:replace_book 13 | # 14 | # Display help in chat and enable for all players 15 | # 16 | execute as @a[scores={as_help=1..}] at @s run function armor_statues:help 17 | # 18 | # Item frame armor stand animation 19 | # 20 | scoreboard players add #animate_time as_angle 1 21 | execute unless score #animate_trigger as_angle matches 0 if score #animate_time as_angle >= #animate_trigger as_angle run function armor_statues:animate_time 22 | -------------------------------------------------------------------------------- /data/armor_statues/functions/repeat/redo.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Undo last armor stand action 3 | # Called by: as_statue:repeat/undo_redo 4 | # Entity @s: player 5 | # 6 | # Copies current state to undo states 7 | # 8 | function armor_statues:repeat/save_undo_state 9 | # 10 | # Copies last redo state to armor stand 11 | # 12 | data modify entity @e[type=minecraft:armor_stand,sort=nearest,limit=1] {} merge from storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[0] 13 | data modify entity @e[type=minecraft:armor_stand,sort=nearest,limit=1] Pose set from storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[0].Pose 14 | # 15 | # Deletes redo state 16 | # 17 | data remove storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[0] 18 | # 19 | # Modifies book data 20 | # 21 | execute as @s run function armor_statues:storage_out -------------------------------------------------------------------------------- /data/armor_statues/functions/repeat/undo.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Undo last armor stand action 3 | # Called by: as_statue:repeat/undo_redo 4 | # Entity @s: player 5 | # 6 | # Copies current state to redo states 7 | # 8 | function armor_statues:repeat/save_redo_state 9 | # 10 | # Copies last undo state to armor stand 11 | # 12 | data modify entity @e[type=minecraft:armor_stand,sort=nearest,limit=1] {} merge from storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[0] 13 | data modify entity @e[type=minecraft:armor_stand,sort=nearest,limit=1] Pose set from storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[0].Pose 14 | # 15 | # Deletes undo state state 16 | # 17 | data remove storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[0] 18 | # 19 | # Modifies book data 20 | # 21 | execute as @s run function armor_statues:storage_out -------------------------------------------------------------------------------- /data/armor_statues/functions/locking/unlock.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Unlocks locked armor stand 3 | # Called by: armor_statues:trigger/lock 4 | # Entity @s: nearest locked armor stand 5 | # 6 | execute as @p[tag=as_selected,tag=!as_chat] run title @s actionbar {"text":"Armor stand unlocked","color":"dark_green"} 7 | execute as @p[tag=as_selected,tag=as_chat] run tellraw @s {"text":" Armor stand unlocked","color":"dark_green"} 8 | execute if entity @p[tag=as_selected] run effect give @s minecraft:glowing 1 9 | data merge entity @s {DisabledSlots:0} 10 | tag @s remove as_locked 11 | # removes tag for tool rack if present 12 | tag @s[tag=as_tool_rack] remove as_tool_rack 13 | # 14 | # add Player UUID lock 15 | # 16 | scoreboard players reset @s as_lock_uuid1 17 | scoreboard players reset @s as_lock_uuid2 18 | scoreboard players reset @s as_lock_uuid3 19 | scoreboard players reset @s as_lock_uuid4 20 | tag @s remove as_uuid_locked -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/facing.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Adjust rotation of armor stand 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor stand 5 | # 6 | # Note: The function is being executed at the location of the armor stand so @p is not necessarily the original player 7 | # 8 | # Rotate the armor stand to face the selected player 9 | # 10 | tp @s ~ ~ ~ facing entity @a[distance=..3,tag=as_selected,limit=1] 11 | # 12 | # If stand is required to face away from the player, add 180 to the rotation 13 | # 14 | execute if entity @s[scores={as_trigger=125}] store result score @s as_pose run data get entity @s Rotation[0] 1 15 | execute if entity @s[scores={as_trigger=125}] run scoreboard players add @s as_pose 180 16 | execute if entity @s[scores={as_trigger=125}] store result entity @s Rotation[0] float 1 run scoreboard players get @s as_pose 17 | # 18 | # Tag the armor stand as modified 19 | # 20 | tag @s add as_modified 21 | -------------------------------------------------------------------------------- /data/armor_statues/functions/locking/lock.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Locks armor stand 3 | # Called by: armor_statues:trigger/lock 4 | # Entity @s: armor stand 5 | # 6 | execute as @p[tag=as_selected,tag=!as_chat] run title @s actionbar {"text":"Armor stand locked","color":"dark_green"} 7 | execute as @p[tag=as_selected,tag=as_chat] run tellraw @s {"text":" Armor stand locked","color":"dark_green"} 8 | effect give @s minecraft:glowing 1 9 | data merge entity @s {DisabledSlots:4144959} 10 | tag @s add as_locked 11 | # 12 | # add Player UUID lock 13 | # 14 | execute store result score @s as_lock_uuid1 run data get entity @p[tag=as_selected] UUID[0] 15 | execute store result score @s as_lock_uuid2 run data get entity @p[tag=as_selected] UUID[1] 16 | execute store result score @s as_lock_uuid3 run data get entity @p[tag=as_selected] UUID[2] 17 | execute store result score @s as_lock_uuid4 run data get entity @p[tag=as_selected] UUID[3] 18 | tag @s add as_uuid_locked -------------------------------------------------------------------------------- /pack.info: -------------------------------------------------------------------------------- 1 | # Everything you should know about this pack: 2 | 3 | 1. This datapack uses a book of clickable links to modify the settings and pose of armour stands. 4 | 2. Once the datapack is installed, use "/trigger as_help" to see how to obtain the book. 5 | By default this is by clicking a link in the help text but this can be changed in the admin settings. 6 | 3. Admin settings are available using "/function armor_statues:admin" command and include: 7 | - Creating and removing a particle shrine for obtaining the book. 8 | - Enabling and disabling a crafting method for obtaining the book. 9 | - Enabling and disabling the link in the help text for obtaining the book. 10 | - Removing unused armour stands; ones that are invisible and do not hold or wear any items. 11 | 4. The help text will be amended to show the selected method(s) of obtaining the book 12 | 5. The help text also includes options to have notification messages in either the action bar or in chat. 13 | -------------------------------------------------------------------------------- /data/armor_statues/advancements/armor_statues.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecraft:armor_stand" 5 | }, 6 | "title": " Armor Statues ", 7 | "frame": "challenge", 8 | "description": ["",{"text":"Adds a unique book that allows you to alter the properties of armor stands in survival. ","color":"gold"},{"text":"Datapack by: ","color":"green"},{"text":"Phssthpok, MSpaceDev, and MukiTanuki\n","color":"aqua"},{"text":"Enter","color":"green"},{"text":" ","color":"gold"},{"text":"/trigger as_help","color":"yellow"},{"text":" for details.\n","color":"gold"},{"text":"Enter","color":"green"},{"text":" ","color":"gold"},{"text":"/function armor_statues:admin","color":"yellow"},{"text":" and use auto-complete to set config options.","color":"gold"}], 9 | "background": "minecraft:textures/block/black_concrete.png", 10 | "show_toast": false, 11 | "announce_to_chat": false 12 | }, 13 | "criteria": { 14 | "tick": { 15 | "trigger": "minecraft:tick" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /data/armor_statues/functions/sealing/seal.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Seals armor stand 3 | # Called by: armor_statues:trigger/lock 4 | # Entity @s: player - mod 5 | # 6 | execute if entity @s[tag=!as_chat] if entity @e[type=armor_stand,distance=..3,tag=!as_sealed,sort=nearest,limit=1] run title @s actionbar {"text":"Armor stand sealed","color":"dark_green"} 7 | execute if entity @s[tag=as_chat] if entity @e[type=armor_stand,distance=..3,tag=!as_sealed,sort=nearest,limit=1] run tellraw @s {"text":" Armor stand sealed","color":"dark_green"} 8 | execute as @e[type=armor_stand,distance=..3,tag=!as_sealed,sort=nearest,limit=1] run effect give @s minecraft:glowing 1 9 | execute as @e[type=armor_stand,distance=..3,tag=!as_sealed,sort=nearest,limit=1] run data merge entity @s {Invulnerable:1b,DisabledSlots:4144959} 10 | execute as @e[type=armor_stand,distance=..3,tag=!as_sealed,sort=nearest,limit=1] run tag @s add as_locked 11 | execute as @e[type=armor_stand,distance=..3,tag=!as_sealed,sort=nearest,limit=1] run tag @s add as_sealed -------------------------------------------------------------------------------- /data/armor_statues/functions/sealing/unseal.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Unseals sealed armor stand 3 | # Called by: armor_statues:trigger/lock 4 | # Entity @s: player - mod 5 | # 6 | execute if entity @s[tag=!as_chat] if entity @e[type=armor_stand,distance=..3,tag=as_sealed,sort=nearest,limit=1] run title @s actionbar {"text":"Armor stand unsealed","color":"dark_green"} 7 | execute if entity @s[tag=as_chat] if entity @e[type=armor_stand,distance=..3,tag=as_sealed,sort=nearest,limit=1] run tellraw @p {"text":" Armor stand unsealed","color":"dark_green"} 8 | execute as @e[type=armor_stand,distance=..3,tag=as_sealed,sort=nearest,limit=1] run effect give @s minecraft:glowing 1 9 | execute as @e[type=armor_stand,distance=..3,tag=as_sealed,sort=nearest,limit=1] run data merge entity @s {Invulnerable:0b,DisabledSlots:0} 10 | execute as @e[type=armor_stand,distance=..3,tag=as_sealed,sort=nearest,limit=1] run tag @s remove as_locked 11 | execute as @e[type=armor_stand,distance=..3,tag=as_sealed,sort=nearest,limit=1] run tag @s remove as_sealed -------------------------------------------------------------------------------- /data/armor_statues/functions/item_frames/invisible_old.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: turns item frame invisible 3 | # Called by: armor_statues:if_trigger 4 | # Entity @s: item frame 5 | # 6 | # 7 | # If no potion in hand, display failure message 8 | # 9 | execute if entity @p[tag=as_selected,predicate=!armor_statues:mainhand_potion,predicate=!armor_statues:offhand_potion] run title @a[tag=as_selected,tag=!as_chat] actionbar [{"text":"Requires invisibility potion in Mainhand or Offhand","color":"dark_red"}] 10 | execute if entity @p[tag=as_selected,predicate=!armor_statues:mainhand_potion,predicate=!armor_statues:offhand_potion] run tellraw @a[tag=as_selected,tag=as_chat] [{"text":" ","color":"dark_green"},{"text":"Requires invisibility potion in Mainhand or Offhand","color":"dark_red"}] 11 | # 12 | # If player has a potion in hand, successfully trigger 13 | # 14 | execute unless entity @p[tag=as_selected,predicate=!armor_statues:mainhand_potion,predicate=!armor_statues:offhand_potion] run function armor_statues:item_frames/invisible_success 15 | -------------------------------------------------------------------------------- /data/armor_statues/functions/admin/unused.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Removes all unused armor stands in loaded chunks 3 | # Called by: armor_statues:admin via chat clickEvent 4 | # Entity @s: Player 5 | # 6 | # Note: "Unused" stands are invisible, are not holding or wearing items, and are not part of a tool rack 7 | # 8 | # Store number of affected stands for reporting 9 | # 10 | execute store result score @s as_pose run execute if entity @e[type=armor_stand,nbt={Invisible:1b},nbt=!{HandItems:[{Count:1b}]},nbt=!{ArmorItems:[{Count:1b}]},nbt=!{DisabledSlots:4079166},nbt=!{Invulnerable:1b},nbt=!{Marker:1b}] 11 | # 12 | # Kill affected stands 13 | # 14 | execute as @e[type=armor_stand,nbt={Invisible:1b},nbt=!{HandItems:[{Count:1b}]},nbt=!{ArmorItems:[{Count:1b}]},nbt=!{DisabledSlots:4079166},nbt=!{Invulnerable:1b},nbt=!{Marker:1b}] run kill @s 15 | # 16 | # Report number affected 17 | # 18 | tellraw @p [{"score":{"name":"@s","objective":"as_pose"},"color":"aqua"},{"text":" unused armor stands deleted","color":"aqua"}] 19 | # 20 | scoreboard players reset @s as_pose 21 | -------------------------------------------------------------------------------- /data/armor_statues/loot_tables/replace_save.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:entity", 3 | "pools": [ 4 | { 5 | "rolls": 1, 6 | "entries": [ 7 | { 8 | "type": "minecraft:item", 9 | "name": "minecraft:written_book", 10 | "functions": [ 11 | { 12 | "function": "minecraft:copy_nbt", 13 | "source": "this", 14 | "ops": [ 15 | { 16 | "source": "HandItems[1].tag", 17 | "target": "{}", 18 | "op": "merge" 19 | } 20 | ] 21 | }, 22 | { 23 | "function": "minecraft:set_lore", 24 | "lore": [ 25 | [ 26 | { 27 | "selector": "@e[type=armor_stand,limit=1,sort=nearest,tag=as_selected]" 28 | }, 29 | { 30 | "text": " Pose +" 31 | } 32 | ] 33 | ], 34 | "entity": "this", 35 | "replace": "true" 36 | }, 37 | { 38 | "function": "minecraft:set_count", 39 | "count": 0 40 | }, 41 | { 42 | "function": "minecraft:looting_enchant", 43 | "count":1 44 | } 45 | ] 46 | } 47 | ] 48 | } 49 | ] 50 | } -------------------------------------------------------------------------------- /data/armor_statues/functions/admin/marker.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # This function is currently not used - see armor_statues:admin for details 3 | # 4 | 5 | # 6 | # Description: Sets the Marker tag on all locked armor stands within 128 blocks 7 | # Called by: armor_statues:admin via chat clickEvent 8 | # Entity @s: Player 9 | # 10 | # Note: DisabledSlots tag is checked to exclude armor stands in tool racks 11 | # 12 | # Store number of affected stands for reporting 13 | # 14 | execute store result score @s as_pose run execute if entity @e[type=armor_stand,distance=..128,tag=as_locked,nbt=!{Marker:1b},nbt=!{DisabledSlots:4079166}] 15 | # 16 | # Set Marker tag on affected stands 17 | # 18 | execute as @e[type=armor_stand,distance=..128,tag=as_locked,nbt=!{Marker:1b},nbt=!{DisabledSlots:4079166}] run data merge entity @s {Marker:1b} 19 | # 20 | # Report number affected 21 | # 22 | tellraw @p [{"text":"Marker set on ","color":"aqua"},{"score":{"name":"@s","objective":"as_pose"},"color":"aqua"},{"text":" armor stands","color":"aqua"}] 23 | # 24 | scoreboard players reset @s as_pose 25 | -------------------------------------------------------------------------------- /data/armor_statues/functions/randomizer/body.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Randomizes appendage rotation 3 | # Called by: armor_statues:trigger/random_pose 4 | # Entity @s: temp armor stand 5 | # 6 | execute store result score #x_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"body_x" }].Amount 1000 7 | execute store result score #y_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"body_y" }].Amount 1000 8 | execute store result score #z_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"body_z" }].Amount 1000 9 | function armor_statues:randomizer/body_angle 10 | execute store result storage customizable_armor_stands:pose_storage Pose.Body[0] float 0.001 run scoreboard players get #x_angle as_angle 11 | execute store result storage customizable_armor_stands:pose_storage Pose.Body[1] float 0.001 run scoreboard players get #y_angle as_angle 12 | execute store result storage customizable_armor_stands:pose_storage Pose.Body[2] float 0.001 run scoreboard players get #z_angle as_angle -------------------------------------------------------------------------------- /data/armor_statues/functions/randomizer/head.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Randomizes appendage rotation 3 | # Called by: armor_statues:trigger/random_pose 4 | # Entity @s: temp armor stand 5 | # 6 | execute store result score #x_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"head_x" }].Amount 1000 7 | execute store result score #y_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"head_y" }].Amount 1000 8 | execute store result score #z_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"head_z" }].Amount 1000 9 | function armor_statues:randomizer/head_angle 10 | execute store result storage customizable_armor_stands:pose_storage Pose.Head[0] float 0.001 run scoreboard players get #x_angle as_angle 11 | execute store result storage customizable_armor_stands:pose_storage Pose.Head[1] float 0.001 run scoreboard players get #y_angle as_angle 12 | execute store result storage customizable_armor_stands:pose_storage Pose.Head[2] float 0.001 run scoreboard players get #z_angle as_angle -------------------------------------------------------------------------------- /data/armor_statues/functions/help/credits.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Display credits in chat 3 | # Called by: armor_statues:help 4 | # Entity @s: Player 5 | # 6 | tellraw @s [{"text":"Customizable Armor Stands - Credits","color":"yellow","bold":"true"}] 7 | tellraw @s [{"text":"Coding and original concept: ","color":"aqua"},{"text":"Phssthpok","color":"#87325d","bold":"true","clickEvent":{"action":"open_url","value":"https://twitter.com/MCPhssthpok"}}] 8 | tellraw @s ["",{"text":"Additional improvements: ","color":"aqua"},{"text":"MSpaceDev","color":"#e30000","bold":"true","clickEvent":{"action":"open_url","value":"https://www.youtube.com/c/MinecraftSpace"}}] 9 | tellraw @s [{"text":"Development and improvements: ","color":"aqua"},{"text":"MukiTanuki","color":"#0072e5","bold":"true","clickEvent":{"action":"open_url","value":"https://twitter.com/MukiTanuki"}}] 10 | tellraw @s [{"text":"\nThanks to many other people for help with testing and suggestions -Phssthpok","color":"aqua"}] 11 | tellraw @s [{"text":"--------------------------","color":"yellow","bold":"true"}] 12 | -------------------------------------------------------------------------------- /data/armor_statues/functions/randomizer/left_leg.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Randomizes appendage rotation 3 | # Called by: armor_statues:trigger/random_pose 4 | # Entity @s: temp armor stand 5 | # 6 | execute store result score #x_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"left_leg_x" }].Amount 1000 7 | execute store result score #y_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"left_leg_y" }].Amount 1000 8 | execute store result score #z_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"left_leg_z" }].Amount 1000 9 | function armor_statues:randomizer/left_leg_angle 10 | execute store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[0] float 0.001 run scoreboard players get #x_angle as_angle 11 | execute store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[1] float 0.001 run scoreboard players get #y_angle as_angle 12 | execute store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[2] float 0.001 run scoreboard players get #z_angle as_angle -------------------------------------------------------------------------------- /data/armor_statues/functions/randomizer/right_leg.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Randomizes appendage rotation 3 | # Called by: armor_statues:trigger/random_pose 4 | # Entity @s: temp armor stand 5 | # 6 | execute store result score #x_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"right_leg_x" }].Amount 1000 7 | execute store result score #y_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"right_leg_y" }].Amount 1000 8 | execute store result score #z_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"right_leg_z" }].Amount 1000 9 | function armor_statues:randomizer/right_leg_angle 10 | execute store result storage customizable_armor_stands:pose_storage Pose.RightLeg[0] float 0.001 run scoreboard players get #x_angle as_angle 11 | execute store result storage customizable_armor_stands:pose_storage Pose.RightLeg[1] float 0.001 run scoreboard players get #y_angle as_angle 12 | execute store result storage customizable_armor_stands:pose_storage Pose.RightLeg[2] float 0.001 run scoreboard players get #z_angle as_angle -------------------------------------------------------------------------------- /data/armor_statues/functions/bugfix.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: This is a temporary (?) workaround for bug MC-80975 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor_stand 5 | # 6 | # Pose data is not stored for parts of the armor stand that are in the "default" positions. This causes the execute store entity 7 | # and data get entity commands to fail. 8 | # 9 | # This function checks for the presence of each parts' pose data and updates it with tweaked default values if not present 10 | # 11 | execute unless data entity @s Pose.Head run data merge entity @s {Pose:{Head:[0.0f,0.001f,0.0f]}} 12 | execute unless data entity @s Pose.Body run data merge entity @s {Pose:{Body:[0.0f,0.001f,0.0f]}} 13 | execute unless data entity @s Pose.LeftArm run data merge entity @s {Pose:{LeftArm:[-10.0f,0.001f,-10.0f]}} 14 | execute unless data entity @s Pose.RightArm run data merge entity @s {Pose:{RightArm:[-15.0f,0.001f,10.0f]}} 15 | execute unless data entity @s Pose.LeftLeg run data merge entity @s {Pose:{LeftLeg:[-1.0f,0.001f,-1.0f]}} 16 | execute unless data entity @s Pose.RightLeg run data merge entity @s {Pose:{RightLeg:[1.0f,0.001f,1.0f]}} 17 | -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/slots.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Exchange items between equipment slots 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor stand 5 | # 6 | # Creates temporary storage 7 | # 8 | #data modify storage customizable_armor_stands:slot_storage {} set value {Slots:[{}, {}]} 9 | # 10 | # Copy item from main hand to temporary storage 11 | # 12 | data modify storage customizable_armor_stands:slot_storage Slot set from entity @s HandItems[0] 13 | # 14 | # Copy item from off hand or head to main hand 15 | # 16 | execute if entity @s[scores={as_trigger=161}] run data modify entity @s HandItems[0] set from entity @s HandItems[1] 17 | execute if entity @s[scores={as_trigger=162}] run data modify entity @s HandItems[0] set from entity @s ArmorItems[3] 18 | # 19 | # Copy item from temporary storage to off hand or head 20 | # 21 | execute if entity @s[scores={as_trigger=161}] run data modify entity @s HandItems[1] set from storage customizable_armor_stands:slot_storage Slot 22 | execute if entity @s[scores={as_trigger=162}] run data modify entity @s ArmorItems[3] set from storage customizable_armor_stands:slot_storage Slot 23 | -------------------------------------------------------------------------------- /data/armor_statues/functions/second.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Check for players with trigger score set 3 | # Called by: #minecraft:tick 4 | # Entity @s: none 5 | # 6 | schedule function armor_statues:second 1s 7 | # 8 | # Repeat trigger 9 | # 10 | execute as @a[scores={as_repeat=1..}] at @s run function armor_statues:repeat_trigger 11 | # 12 | # Armor stand trigger 13 | # 14 | execute as @a[scores={as_trigger=1..}] at @s run function armor_statues:trigger 15 | # 16 | # Item Frame trigger 17 | # 18 | execute as @a[scores={if_invisible=1..}] at @s run function armor_statues:if_trigger 19 | # 20 | # Makes empty invisible item frames visible 21 | # 22 | execute as @e[type=#armor_statues:item_frames,tag=if_invisible,nbt=!{Item:{Count:1b}}] run function armor_statues:item_frames/visible 23 | # 24 | # Check for players at the particle shrine 25 | # 26 | execute as @e[tag=as_shrine] at @s run function armor_statues:shrine/main 27 | # 28 | # resets crafting advancement 29 | # 30 | execute if data storage customizable_armor_stands:settings as_admin{book_craft:"Enabled"} as @a[advancements={armor_statues:crafting=true}] run advancement revoke @s only armor_statues:crafting -------------------------------------------------------------------------------- /data/armor_statues/functions/repeat/save_state.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Copies last state for undoing 3 | # Called by: as_statue:repeat/save 4 | # Entity @s: player 5 | # 6 | # Checks if UUID of armor stand matches that of the book 7 | # 8 | scoreboard players set #as_success as_angle 0 9 | execute store success score #as_success as_angle run data modify storage customizable_armor_stands:book_storage SavedItem.tag.StatesUUID set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] UUID 10 | execute if score #as_success as_angle matches 1 run data remove storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates 11 | data remove storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates 12 | # 13 | # Counts undo states and makes sure they're less than the maximum undo states 14 | # 15 | execute store result score #as_temp as_angle run data get storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates 16 | execute if score #as_temp as_angle >= #undo_states as_angle run data remove storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[-1] 17 | # 18 | function armor_statues:repeat/save_undo_state 19 | -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/rotation.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Adjust rotation of armor stand 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor stand 5 | # 6 | # Note: The function is being executed at the location of the original player, not the armor stand, so @p must be the same player 7 | # 8 | # Trigger values 52 thru 55 are redundant and kept for backwards compatibility 9 | # 10 | execute if entity @s[scores={as_trigger=52..57}] store result score @s as_pose run data get entity @s Rotation[0] 1 11 | execute if entity @s[scores={as_trigger=52}] run scoreboard players add @s as_pose 45 12 | execute if entity @s[scores={as_trigger=53}] run scoreboard players add @s as_pose 5 13 | execute if entity @s[scores={as_trigger=54}] run scoreboard players remove @s as_pose 5 14 | execute if entity @s[scores={as_trigger=55}] run scoreboard players remove @s as_pose 45 15 | execute if entity @s[scores={as_trigger=56}] run scoreboard players operation @s as_pose += @p as_angle 16 | execute if entity @s[scores={as_trigger=57}] run scoreboard players operation @s as_pose -= @p as_angle 17 | execute if entity @s[scores={as_trigger=52..57}] store result entity @s Rotation[0] float 1 run scoreboard players get @s as_pose 18 | # 19 | # Tag the armor stand as modified 20 | # 21 | tag @s add as_modified 22 | -------------------------------------------------------------------------------- /data/armor_statues/functions/relative_position_aligned_nudge.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Nudge postion of armor stand relative to player and aligned to the world grid 3 | # Called by: armor_statues:trigger/position_relative 4 | # Entity @s: armor stand 5 | # 6 | # X/Left/Right 7 | execute if entity @p[tag=as_selected,scores={as_trigger=1100}] run tp @s ^-0.5 ^ ^ 8 | execute if entity @p[tag=as_selected,scores={as_trigger=1101}] run tp @s ^-0.1875 ^ ^ 9 | execute if entity @p[tag=as_selected,scores={as_trigger=1102}] run tp @s ^-0.0625 ^ ^ 10 | execute if entity @p[tag=as_selected,scores={as_trigger=1103}] run tp @s ^0.0625 ^ ^ 11 | execute if entity @p[tag=as_selected,scores={as_trigger=1104}] run tp @s ^0.1875 ^ ^ 12 | execute if entity @p[tag=as_selected,scores={as_trigger=1105}] run tp @s ^0.5 ^ ^ 13 | # Z/Forward/backward 14 | execute if entity @p[tag=as_selected,scores={as_trigger=1106}] run tp @s ^ ^ ^-0.5 15 | execute if entity @p[tag=as_selected,scores={as_trigger=1107}] run tp @s ^ ^ ^-0.1875 16 | execute if entity @p[tag=as_selected,scores={as_trigger=1108}] run tp @s ^ ^ ^-0.0625 17 | execute if entity @p[tag=as_selected,scores={as_trigger=1109}] run tp @s ^ ^ ^0.0625 18 | execute if entity @p[tag=as_selected,scores={as_trigger=1110}] run tp @s ^ ^ ^0.1875 19 | execute if entity @p[tag=as_selected,scores={as_trigger=1111}] run tp @s ^ ^ ^0.5 20 | -------------------------------------------------------------------------------- /data/armor_statues/functions/enable.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Enable system for the player and issue control book 3 | # Called by: command block 4 | # Entity @s: player 5 | # 6 | # Trigger values in use are: 1-12 Style settings 7 | # 20-39 Pose presets 8 | # 40-51 Nudge position 9 | # 52-57 Adjust rotation 10 | # 60-95 Pose adjustment 11 | # 101-112 Nudge position 12 | # 120-123 Angle step 13 | # 124-125 Face towards or away 14 | # 131-135 Pose mirror and flip 15 | # 141-142 Pose presets 16 | # 151-155 Auto alignment 17 | # 161-162 Exchange Slots 18 | # 999 Check target 19 | # 1000-1003 Lock and seal 20 | # 1004-1005 Copy and paste 21 | # 1100-1129 Nuge position relative 22 | # 1150 Random pose 23 | # 1160-1171 Pointing 24 | # 1200-1201 Undo/Redo 25 | # 26 | # Set trigger score for player to zero and enable 27 | # 28 | scoreboard players set @s as_trigger 0 29 | scoreboard players enable @s as_trigger 30 | scoreboard players set @s as_help 0 31 | scoreboard players enable @s as_help 32 | scoreboard players set @s if_invisible 0 33 | scoreboard players enable @s if_invisible 34 | scoreboard players set @s as_repeat 0 35 | scoreboard players enable @s as_repeat 36 | # 37 | # Set angle step for rotation and pose adjustment to default 15 degrees 38 | # 39 | scoreboard players set @s as_angle 15 40 | -------------------------------------------------------------------------------- /data/armor_statues/functions/locking/uuid_check.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Checks UUID of player against the UUID of the armor stand and player 3 | # Called by: armor_statues:trigger/lock 4 | # Entity @s: nearest locked armor stand 5 | # 6 | execute store result score @p[tag=as_selected] as_lock_uuid1 run data get entity @p[tag=as_selected] UUID[0] 7 | execute store result score @p[tag=as_selected] as_lock_uuid2 run data get entity @p[tag=as_selected] UUID[1] 8 | execute store result score @p[tag=as_selected] as_lock_uuid3 run data get entity @p[tag=as_selected] UUID[2] 9 | execute store result score @p[tag=as_selected] as_lock_uuid4 run data get entity @p[tag=as_selected] UUID[3] 10 | # 11 | scoreboard players set #as_success as_help 0 12 | execute store success score #as_success as_help if score @p[tag=as_selected] as_lock_uuid1 = @s as_lock_uuid1 if score @p[tag=as_selected] as_lock_uuid2 = @s as_lock_uuid2 if score @p[tag=as_selected] as_lock_uuid3 = @s as_lock_uuid3 if score @p[tag=as_selected] as_lock_uuid4 = @s as_lock_uuid4 run function armor_statues:locking/unlock 13 | # 14 | execute if score #as_success as_help matches 0 as @p[tag=as_selected,tag=!as_chat] run title @s actionbar {"text":"Can't modify armor stands locked by a different player","color":"dark_red"} 15 | execute if score #as_success as_help matches 0 as @p[tag=as_selected,tag=as_chat] run tellraw @s [{"text":" ","color":"dark_green"},{"text":"Can't modify armor stands locked by a different player","color":"dark_red"}] -------------------------------------------------------------------------------- /data/armor_statues/functions/3_second.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Check for players with trigger score set 3 | # Called by: #minecraft:load 4 | # Entity @s: none 5 | # 6 | schedule function armor_statues:3_second 3s 7 | # 8 | # Tags item frames with a book in them 9 | # 10 | 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 11 | # Untags 12 | 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 13 | # 14 | # Turns invisible armor stands visible if they don't have any items, customNameVisible, aren't locked, are markers, or invulnerable 15 | # 16 | 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 17 | # 18 | # Unlocks tool rack armor stands if the tripwire hook is broken 19 | # 20 | 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 21 | 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 -------------------------------------------------------------------------------- /data/armor_statues/functions/item_frames/fixed.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: turns item frame invisible 3 | # Called by: armor_statues:if_trigger 4 | # Entity @s: #item frame 5 | # 6 | # Makes item frame fixed 7 | # 8 | execute if entity @p[tag=as_selected,scores={if_invisible=2}] unless entity @s[tag=if_fixed] run title @a[tag=as_selected,tag=!as_chat] actionbar [{"text":"Item frame fixed","color":"dark_green"}] 9 | execute if entity @p[tag=as_selected,scores={if_invisible=2}] unless entity @s[tag=if_fixed] run tellraw @a[tag=as_selected,tag=as_chat] [{"text":" ","color":"dark_green"},{"text":"Item frame fixed","color":"dark_red"}] 10 | # 11 | execute if entity @p[tag=as_selected,scores={if_invisible=2}] unless entity @s[tag=if_fixed] run data merge entity @s {Fixed:1b} 12 | execute if entity @p[tag=as_selected,scores={if_invisible=2}] unless entity @s[tag=if_fixed] run tag @s add if_fixed 13 | # 14 | # Unfixes item frame 15 | # 16 | execute if entity @p[tag=as_selected,scores={if_invisible=3}] if entity @s[tag=if_fixed] run title @a[tag=as_selected,tag=!as_chat] actionbar [{"text":"Item frame no longer fixed","color":"dark_green"}] 17 | execute if entity @p[tag=as_selected,scores={if_invisible=3}] if entity @s[tag=if_fixed] run tellraw @a[tag=as_selected,tag=as_chat] [{"text":" ","color":"dark_green"},{"text":"Item frame no longer fixed","color":"dark_green"}] 18 | # 19 | execute if entity @p[tag=as_selected,scores={if_invisible=3}] if entity @s[tag=if_fixed] run data merge entity @s {Fixed:0b} 20 | execute if entity @p[tag=as_selected,scores={if_invisible=3}] if entity @s[tag=if_fixed] run tag @s remove if_fixed 21 | -------------------------------------------------------------------------------- /data/armor_statues/functions/storage_out_copy.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Copies stored book from storage into mainhand or offhand (only for copying at the moment) 3 | # Called by: as_statue:trigger\copy 4 | # Entity @s: player 5 | # 6 | # Copies data to a temp pig 7 | # 8 | summon minecraft:pig ~ 0 ~ {DeathLootTable:"armor_statues:replace_save", Invulnerable:1b, NoGravity:1b, Silent:1b, ActiveEffects:[{Id:14,Amplifier:0,Duration:2147483647}], NoAI:1b, PersistenceRequired:1b, Tags:["as_temp"], HandItems:[{id:"minecraft:stone_button", Count:1b, tag:{ Enchantments:[{ lvl:1s, id:"minecraft:looting"} ]}},{}] } 9 | # 10 | data modify entity @e[tag=as_temp, type=minecraft:pig, sort=nearest, limit=1] HandItems[1] set from storage customizable_armor_stands:book_storage SavedItem 11 | # 12 | # Copies count to looting for book count 13 | # 14 | execute store result entity @e[tag=as_temp, type=minecraft:pig, sort=nearest, limit=1] HandItems[0].tag.Enchantments[0].lvl short 1 run data get storage customizable_armor_stands:book_storage SavedItem.Count 15 | # 16 | execute if entity @s[nbt={SelectedItem:{id:"minecraft:written_book", tag:{datapack:"ArmorStatuesV2"}}}] as @e[tag=as_temp, type=minecraft:pig, limit=1,sort=nearest] run loot replace entity @p[tag=as_selected] weapon.mainhand kill @s 17 | execute if entity @s[nbt={Inventory:[{id:"minecraft:written_book", Slot:-106b, tag:{datapack:"ArmorStatuesV2"}}]}] unless entity @s[nbt={SelectedItem:{id:"minecraft:written_book", tag:{datapack:"ArmorStatuesV2"}}}] as @e[tag=as_temp, type=minecraft:pig, sort=nearest, limit=1] run loot replace entity @p[tag=as_selected] weapon.offhand kill @s 18 | # 19 | # Kills temp pig 20 | # 21 | tp @e[type=minecraft:pig, tag=as_temp] ~ -300 ~ 22 | kill @e[type=minecraft:pig, tag=as_temp] -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/copy.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Copies selected armor stand settings and pose to the book 3 | # Called by: as_statue:trigger 4 | # Entity @s: armor stand 5 | # 6 | execute as @p[tag=as_selected] run function armor_statues:storage_in 7 | # 8 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose set value {Pose: {RightArm: [0f, 0f, 0f], LeftLeg: [0f, 0f, 0f], Head: [0f, 0f, 0f], LeftArm: [0f, 0f, 0f], RightLeg: [0f, 0f, 0f], Body: [0f, 0f, 0f]}, NoBasePlate:0b, ShowArms:0b, Small:0b, Invisible:0b, CustomNameVisible:0b} 9 | # 10 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose.Pose merge from entity @s Pose 11 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose.NoBasePlate set from entity @s NoBasePlate 12 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose.ShowArms set from entity @s ShowArms 13 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose.Small set from entity @s Small 14 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose.Invisible set from entity @s Invisible 15 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose.CustomNameVisible set from entity @s CustomNameVisible 16 | # 17 | execute as @p[tag=as_selected] run function armor_statues:storage_out 18 | # 19 | title @a[tag=as_selected,tag=!as_chat] actionbar [{"selector":"@s","color":"dark_green"}, {"text":" Pose and settings copied to the book","color":"dark_green"}] 20 | tellraw @a[tag=as_selected,tag=as_chat] [{"text":" ","color":"dark_green"}, {"selector":"@s","color":"dark_green"}, {"text":" Pose and settings copied to the book","color":"dark_green"}] 21 | effect give @s minecraft:glowing 1 22 | -------------------------------------------------------------------------------- /data/armor_statues/functions/relative_position_nudge.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Nudge postion of armor stand relative to player 3 | # Called by: armor_statues:trigger/position_relative 4 | # Entity @s: armor stand 5 | # 6 | # X/Left/Right 7 | execute if entity @p[tag=as_selected,scores={as_trigger=1112}] run tp @s ^-0.5 ^ ^ 8 | execute if entity @p[tag=as_selected,scores={as_trigger=1113}] run tp @s ^-0.1875 ^ ^ 9 | execute if entity @p[tag=as_selected,scores={as_trigger=1114}] run tp @s ^-0.0625 ^ ^ 10 | execute if entity @p[tag=as_selected,scores={as_trigger=1115}] run tp @s ^0.0625 ^ ^ 11 | execute if entity @p[tag=as_selected,scores={as_trigger=1116}] run tp @s ^0.1875 ^ ^ 12 | execute if entity @p[tag=as_selected,scores={as_trigger=1117}] run tp @s ^0.5 ^ ^ 13 | # Y/Up/Down 14 | execute if entity @p[tag=as_selected,scores={as_trigger=1118}] run tp @s ^ ^-0.5 ^ 15 | execute if entity @p[tag=as_selected,scores={as_trigger=1119}] run tp @s ^ ^-0.1875 ^ 16 | execute if entity @p[tag=as_selected,scores={as_trigger=1120}] run tp @s ^ ^-0.0625 ^ 17 | execute if entity @p[tag=as_selected,scores={as_trigger=1121}] run tp @s ^ ^0.0625 ^ 18 | execute if entity @p[tag=as_selected,scores={as_trigger=1122}] run tp @s ^ ^0.1875 ^ 19 | execute if entity @p[tag=as_selected,scores={as_trigger=1123}] run tp @s ^ ^0.5 ^ 20 | # Z/Forward/backward 21 | execute if entity @p[tag=as_selected,scores={as_trigger=1124}] run tp @s ^ ^ ^-0.5 22 | execute if entity @p[tag=as_selected,scores={as_trigger=1125}] run tp @s ^ ^ ^-0.1875 23 | execute if entity @p[tag=as_selected,scores={as_trigger=1126}] run tp @s ^ ^ ^-0.0625 24 | execute if entity @p[tag=as_selected,scores={as_trigger=1127}] run tp @s ^ ^ ^0.0625 25 | execute if entity @p[tag=as_selected,scores={as_trigger=1128}] run tp @s ^ ^ ^0.1875 26 | execute if entity @p[tag=as_selected,scores={as_trigger=1129}] run tp @s ^ ^ ^0.5 -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/random_pose.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Randomizes armor stand pose 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor stand 5 | # 6 | # Summons temp armor stand 7 | summon minecraft:armor_stand ~ 0 ~ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b} 8 | # 9 | data modify storage customizable_armor_stands:pose_storage Pose set value {Head:[0.0f,0.001f,0.0f], Body:[0.0f,0.001f,0.0f], LeftArm:[-10.0f,0.001f,-10.0f], RightArm:[-15.0f,0.001f,10.0f], LeftLeg:[-1.0f,0.001f,-1.0f], RightLeg:[1.0f,0.001f,1.0f]} 10 | # 11 | loot replace entity @e[type=minecraft:armor_stand,tag=as_temp_armor_stand] armor.head loot armor_statues:random_pose 12 | # 13 | # Generate randomizers 14 | # 15 | execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_temp_armor_stand] run function armor_statues:randomizer/head 16 | execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_temp_armor_stand] run function armor_statues:randomizer/body 17 | execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_temp_armor_stand] run function armor_statues:randomizer/left_arm 18 | execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_temp_armor_stand] run function armor_statues:randomizer/right_arm 19 | execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_temp_armor_stand] run function armor_statues:randomizer/left_leg 20 | execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_temp_armor_stand] run function armor_statues:randomizer/right_leg 21 | # 22 | # Sets random pose 23 | # 24 | data modify entity @s Pose set from storage customizable_armor_stands:pose_storage Pose 25 | # 26 | # Kills temp armor stand 27 | # 28 | kill @e[type=armor_stand,tag=as_temp_armor_stand] 29 | # 30 | # Tag the armor stand as modified 31 | # 32 | tag @s add as_modified -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/lock.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Apply or remove as_sealed and/or as_locked tags 3 | # Called by: armor_statues:trigger 4 | # Entity @s: Player 5 | # 6 | # Locking prevents the book from being used to modify the stand and disables the equipment slots to prevent accidental interaction 7 | # 8 | execute if entity @s[scores={as_trigger=1000}] as @e[type=armor_stand,tag=as_selected] run function armor_statues:locking/lock 9 | # 10 | # Unlocking 11 | # 12 | # creative player 13 | 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 14 | # UUID lock disabled 15 | 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 16 | # UUID lock enabled 17 | 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 18 | # 19 | # Sealing can only be used in creative mode and makes the armor stand invulnerable as well as locking it 20 | # 21 | 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 22 | # 23 | 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 24 | -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/align.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Align held block or item with supporting surface 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor stand 5 | # 6 | # Align block to surface 7 | # 8 | execute if entity @s[scores={as_trigger=151}] 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:[-15.0f,135.0f,0.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}} 9 | execute if entity @s[scores={as_trigger=151}] at @s run tp @s ^0.5725 ^-0.655 ^0.352 10 | # 11 | # Align item to surface (upright) 12 | # 13 | execute if entity @s[scores={as_trigger=152}] 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:[-90.0f,0.0f,0.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}} 14 | execute if entity @s[scores={as_trigger=152}] at @s run tp @s ^0.36 ^-1.41 ^-0.5625 15 | # 16 | # Align item to surface (flat) 17 | # 18 | execute if entity @s[scores={as_trigger=153}] 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:[0.0f,0.0f,0.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}} 19 | execute if entity @s[scores={as_trigger=153}] at @s run tp @s ^0.385 ^-0.78 ^-0.295 20 | # 21 | # Align tool to surface (flat) 22 | # 23 | 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]}} 24 | execute if entity @s[scores={as_trigger=154}] at @s run tp @s ^-0.17 ^-1.285 ^-0.44 25 | # 26 | # Tag the armor stand as modified and invisible 27 | # 28 | tag @s add as_invisible 29 | tag @s add as_modified 30 | -------------------------------------------------------------------------------- /data/armor_statues/functions/repeat/save_redo_state.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Copies last state for redoing 3 | # Called by: as_statue:repeat/undo 4 | # Entity @s: player 5 | # 6 | # Copies data to redo 7 | # 8 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates prepend value {} 9 | # 10 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[0].Pose set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Pose 11 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[0].NoBasePlate set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] NoBasePlate 12 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[0].ShowArms set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] ShowArms 13 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[0].Small set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Small 14 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[0].Invisible set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Invisible 15 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[0].CustomNameVisible set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] CustomNameVisible 16 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[0].NoGravity set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] NoGravity 17 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[0].Pos set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Pos 18 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[0].Rotation set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Rotation 19 | -------------------------------------------------------------------------------- /data/armor_statues/functions/repeat/save_undo_state.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Copies last state for undoing 3 | # Called by: as_statue:repeat/save 4 | # Entity @s: player 5 | # 6 | # Saves state for undoing 7 | # 8 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates prepend value {} 9 | # 10 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[0].Pose set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Pose 11 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[0].NoBasePlate set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] NoBasePlate 12 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[0].ShowArms set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] ShowArms 13 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[0].Small set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Small 14 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[0].Invisible set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Invisible 15 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[0].CustomNameVisible set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] CustomNameVisible 16 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[0].NoGravity set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] NoGravity 17 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[0].Pos set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Pos 18 | data modify storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[0].Rotation set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] Rotation 19 | -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/align_small.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Align held block or item with supporting surface for small armor stands 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor stand 5 | # 6 | # Align block to surface 7 | # 8 | execute if entity @s[scores={as_trigger=151}] 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:[-15.0f,135.0f,0.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}} 9 | execute if entity @s[scores={as_trigger=151}] at @s run tp @s ^0.28625 ^-0.3275 ^0.176 10 | # 11 | # Align item to surface (upright) 12 | # 13 | execute if entity @s[scores={as_trigger=152}] 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:[-90.0f,0.0f,0.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}} 14 | execute if entity @s[scores={as_trigger=152}] at @s run tp @s ^0.18 ^-0.705 ^-0.28125 15 | # 16 | # Align item to surface (flat) 17 | # 18 | execute if entity @s[scores={as_trigger=153}] 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:[0.0f,0.0f,0.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}} 19 | execute if entity @s[scores={as_trigger=153}] at @s run tp @s ^0.1925 ^-0.39 ^-0.1475 20 | # 21 | # Align tool to surface (flat) 22 | # 23 | 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]}} 24 | execute if entity @s[scores={as_trigger=154}] at @s run tp @s ^-0.085 ^-0.6425 ^-0.22 25 | # 26 | # Tag the armor stand as modified and invisible 27 | # 28 | tag @s add as_invisible 29 | tag @s add as_modified 30 | -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/settings.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Change the armor stand's basic settings 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor stand 5 | # 6 | execute if entity @s[scores={as_trigger=1}] run data merge entity @s {NoBasePlate:0b} 7 | execute if entity @s[scores={as_trigger=2}] run data merge entity @s {NoBasePlate:1b} 8 | execute if entity @s[scores={as_trigger=3}] run data merge entity @s {ShowArms:1b} 9 | execute if entity @s[scores={as_trigger=4}] run data merge entity @s {ShowArms:0b} 10 | execute if entity @s[scores={as_trigger=5}] run data merge entity @s {Small:1b} 11 | execute if entity @s[scores={as_trigger=6}] run data merge entity @s {Small:0b} 12 | execute if entity @s[scores={as_trigger=7}] run data merge entity @s {NoGravity:0b} 13 | execute if entity @s[scores={as_trigger=8}] run data merge entity @s {NoGravity:1b} 14 | execute if entity @s[scores={as_trigger=9}] run data merge entity @s {Invisible:0b} 15 | execute if entity @s[scores={as_trigger=9}] run tag @s remove as_invisible 16 | execute if entity @s[scores={as_trigger=10}] run data merge entity @s {Invisible:1b} 17 | execute if entity @s[scores={as_trigger=10}] run tag @s add as_invisible 18 | execute if entity @s[scores={as_trigger=11}] run data merge entity @s {CustomNameVisible:1b} 19 | execute if entity @s[scores={as_trigger=12}] run data merge entity @s {CustomNameVisible:0b} 20 | # 21 | # Tag the armor stand as modified 22 | # 23 | tag @s add as_modified 24 | # 25 | # Report changes to gravity setting as it is not visible 26 | # 27 | execute if entity @s[scores={as_trigger=7}] run title @a[tag=as_selected,tag=!as_chat] actionbar {"color":"dark_green","text":"Gravity is turned on"} 28 | execute if entity @s[scores={as_trigger=7}] run tellraw @a[tag=as_selected,tag=as_chat] {"color":"dark_green","text":" Gravity is turned on"} 29 | execute if entity @s[scores={as_trigger=8}] run title @a[tag=as_selected,tag=!as_chat] actionbar {"color":"dark_green","text":"Gravity is turned off"} 30 | execute if entity @s[scores={as_trigger=8}] run tellraw @a[tag=as_selected,tag=as_chat] {"color":"dark_green","text":" Gravity is turned off"} 31 | -------------------------------------------------------------------------------- /data/armor_statues/functions/help/main.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Display main help options 3 | # Called by: armor_statues:help 4 | # Entity @s: Player 5 | # 6 | tellraw @s [{"text":"Customizable Armor Stands - Help","color":"yellow","bold":"true"},{"text":"\nGet the book by:","color":"aqua","bold":"false"}] 7 | execute if data storage customizable_armor_stands:settings as_admin{book_help:"Enabled"} run tellraw @s [{"text":" - Clicking ","color":"aqua"},{"text":"here","color":"green","clickEvent":{"action":"run_command","value":"/trigger as_help set 2"}}] 8 | execute if score #as_shrine_x as_help matches ..0 run tellraw @s [{"text":" - Going to the shrine at ","color":"aqua"},{"score":{"name":"#as_shrine_x","objective":"as_help"},"color":"aqua"},{"text":",","color":"aqua"},{"score":{"name":"#as_shrine_z","objective":"as_help"},"color":"aqua"}] 9 | execute if score #as_shrine_x as_help matches 1.. run tellraw @s [{"text":" - Going to the shrine at ","color":"aqua"},{"score":{"name":"#as_shrine_x","objective":"as_help"},"color":"aqua"},{"text":",","color":"aqua"},{"score":{"name":"#as_shrine_z","objective":"as_help"},"color":"aqua"}] 10 | execute if data storage customizable_armor_stands:settings as_admin{book_craft:"Enabled"} run tellraw @s [{"text":" - Crafting a written book titled \"Statues\"","color":"aqua"}] 11 | execute if entity @s[tag=as_chat] run tellraw @s [{"text":"Send notifications to: ","color":"aqua"},{"text":"Chat","color":"green","clickEvent":{"action":"run_command","value":"/trigger as_help set 3"}, "hoverEvent":{"action":"show_text", "contents":{"text":"Click to toggle between Chat and Actionbar", "color":"yellow"}}}] 12 | execute if entity @s[tag=!as_chat] run tellraw @s [{"text":"Send notifications to: ","color":"aqua"},{"text":"Actionbar","color":"green","clickEvent":{"action":"run_command","value":"/trigger as_help set 3"}, "hoverEvent":{"action":"show_text", "contents":{"text":"Click to toggle between Chat and Actionbar", "color":"yellow"}}}] 13 | tellraw @s [{"text":"Credits","color":"green","clickEvent":{"action":"run_command","value":"/trigger as_help set 4"}}] 14 | tellraw @s [{"text":"--------------------------","color":"yellow","bold":"true"}] 15 | -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/position.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Nudge postion of armor stand 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor stand 5 | # 6 | # Trigger values 41, 42, 45, 46, 49 and 50 are redundant and kept for backwards compatibility 7 | # 8 | execute if entity @s[scores={as_trigger=40}] at @s run tp @s ~-0.5 ~ ~ 9 | execute if entity @s[scores={as_trigger=101}] at @s run tp @s ~-0.1875 ~ ~ 10 | execute if entity @s[scores={as_trigger=41}] at @s run tp @s ~-0.1 ~ ~ 11 | execute if entity @s[scores={as_trigger=102}] at @s run tp @s ~-0.0625 ~ ~ 12 | execute if entity @s[scores={as_trigger=103}] at @s run tp @s ~0.0625 ~ ~ 13 | execute if entity @s[scores={as_trigger=42}] at @s run tp @s ~0.1 ~ ~ 14 | execute if entity @s[scores={as_trigger=104}] at @s run tp @s ~0.1875 ~ ~ 15 | execute if entity @s[scores={as_trigger=43}] at @s run tp @s ~0.5 ~ ~ 16 | execute if entity @s[scores={as_trigger=44}] at @s run tp @s ~ ~-0.5 ~ 17 | execute if entity @s[scores={as_trigger=105}] at @s run tp @s ~ ~-0.1875 ~ 18 | execute if entity @s[scores={as_trigger=45}] at @s run tp @s ~ ~-0.1 ~ 19 | execute if entity @s[scores={as_trigger=106}] at @s run tp @s ~ ~-0.0625 ~ 20 | execute if entity @s[scores={as_trigger=107}] at @s run tp @s ~ ~0.0625 ~ 21 | execute if entity @s[scores={as_trigger=46}] at @s run tp @s ~ ~0.1 ~ 22 | execute if entity @s[scores={as_trigger=108}] at @s run tp @s ~ ~0.1875 ~ 23 | execute if entity @s[scores={as_trigger=47}] at @s run tp @s ~ ~0.5 ~ 24 | execute if entity @s[scores={as_trigger=48}] at @s run tp @s ~ ~ ~-0.5 25 | execute if entity @s[scores={as_trigger=109}] at @s run tp @s ~ ~ ~-0.1875 26 | execute if entity @s[scores={as_trigger=49}] at @s run tp @s ~ ~ ~-0.1 27 | execute if entity @s[scores={as_trigger=110}] at @s run tp @s ~ ~ ~-0.0625 28 | execute if entity @s[scores={as_trigger=111}] at @s run tp @s ~ ~ ~0.0625 29 | execute if entity @s[scores={as_trigger=50}] at @s run tp @s ~ ~ ~0.1 30 | execute if entity @s[scores={as_trigger=112}] at @s run tp @s ~ ~ ~0.1875 31 | execute if entity @s[scores={as_trigger=51}] at @s run tp @s ~ ~ ~0.5 32 | # 33 | # Tag the armor stand as modified 34 | # 35 | tag @s add as_modified 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Armor Statues 2 | A datapack that allows you to modify the settings and pose of armor stands using a book with clickable links. 3 | 4 | ### Everything you should know about this pack 5 | 6 | 1. This datapack uses a book of clickable links to modify the settings and pose of armour stands. 7 | 2. Once the datapack is installed, use "/trigger as_help" to see how to obtain the book. 8 | (By default this is by clicking a link in the help text but this can be changed in the admin settings.) 9 | 3. Admin settings are available using "/function armor_statues:admin" command and include: 10 | - Creating and removing a particle shrine for obtaining the book. 11 | - Enabling and disabling a crafting method for obtaining the book. 12 | - Enabling and disabling the link in the help text for obtaining the book. 13 | - Removing unused armour stands; ones that are invisible and do not hold or wear any items. 14 | 4. The help text will be amended to show the selected method(s) of obtaining the book 15 | 5. The help text also includes options to have notification messages in either the action bar or in chat. 16 | 17 | ### Release Notes 18 | #### v2.9.0 BETA 3 19 | - Added Admin Menu features accessed with /function armor_statues:admin 20 | - Added 'Max Undo States': Sets the maximum number of times the armor statues book can Undo actions. Defaults to 10. 21 | - Added 'Item Frame animation time': Sets the amount of time that item frames can be detected and animate armor stands. (16 is recommended) Defaults to 0. 22 | - Saved books now label if they have a saved pose in their Lore. You can name a saved pose by first naming the Armor Stand. 23 | 24 | - Added a new 'states' system to Armor stand books. These can be found on the first page and include Repeat, Undo, and Redo. 25 | 1. Repeat - allows you to perform the same action multiple times. 26 | 2. Undo/Redo - allows you to revert multiple actions. The number of times that actions can be undone is based on the Max Undo States. This resets every time a different armor stand is edited. 27 | 28 | 29 | - Added Item Frame Animators. 30 | 1. Disabled by default. 31 | 2. Allows players to place books(with a saved pose) into item frames to animate armor stands. You can animate them by placing redstone dust in the space with the item frame, then powering it. 32 | 3. Animates the nearest armor stand within 8 blocks. 33 | 4. Animations won't play unless there's a player within 35 blocks of the item frame. 34 | -------------------------------------------------------------------------------- /data/armor_statues/functions/load.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Create scoreboards 3 | # Called by: #main:init 4 | # Entity @s: None 5 | # 6 | # Create scoreboards 7 | # 8 | scoreboard objectives add as_trigger trigger 9 | scoreboard objectives add as_pose dummy 10 | scoreboard objectives add as_angle dummy 11 | scoreboard objectives add as_help trigger 12 | scoreboard objectives add if_invisible trigger 13 | scoreboard objectives add as_repeat trigger 14 | scoreboard objectives add as_edited_uuid1 dummy 15 | scoreboard objectives add as_edited_uuid2 dummy 16 | scoreboard objectives add as_edited_uuid3 dummy 17 | scoreboard objectives add as_edited_uuid4 dummy 18 | scoreboard objectives add as_lock_uuid1 dummy 19 | scoreboard objectives add as_lock_uuid2 dummy 20 | scoreboard objectives add as_lock_uuid3 dummy 21 | scoreboard objectives add as_lock_uuid4 dummy 22 | # 23 | # Resets triggers on reload 24 | # 25 | scoreboard players enable * as_trigger 26 | scoreboard players enable * as_help 27 | scoreboard players enable * if_invisible 28 | scoreboard players enable * as_repeat 29 | # 30 | # Variables 31 | # 32 | scoreboard players set #var15000 as_angle 15000 33 | scoreboard players set #var45000 as_angle 45000 34 | scoreboard players set #var30000 as_angle 30000 35 | scoreboard players set #var60000 as_angle 60000 36 | scoreboard players set #var90000 as_angle 90000 37 | scoreboard players set #var180000 as_angle 180000 38 | scoreboard players set #var360000 as_angle 360000 39 | scoreboard players set #var-1 as_angle -1 40 | # 41 | # Sets storage settings 42 | # 43 | execute unless data storage customizable_armor_stands:settings as_admin.book_craft run data modify storage customizable_armor_stands:settings as_admin.book_craft set value "Enabled" 44 | execute unless data storage customizable_armor_stands:settings as_admin.book_help run data modify storage customizable_armor_stands:settings as_admin.book_help set value "Disabled" 45 | execute unless data storage customizable_armor_stands:settings as_admin.fixed_item_frame run data modify storage customizable_armor_stands:settings as_admin.fixed_item_frame set value "Disabled" 46 | execute unless data storage customizable_armor_stands:settings as_admin.uuid_lock run data modify storage customizable_armor_stands:settings as_admin.uuid_lock set value "Disabled" 47 | execute unless score #undo_states as_angle matches 0.. run scoreboard players set #undo_states as_angle 10 48 | execute unless score #animate_trigger as_angle matches 0.. run scoreboard players set #animate_trigger as_angle 0 49 | -------------------------------------------------------------------------------- /data/armor_statues/functions/repeat/undo_redo.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Checks if armor stand is undoable/redoable 3 | # Called by: as_statue:trigger 4 | # Entity @s: player 5 | # 6 | execute as @s run function armor_statues:storage_in 7 | # 8 | # Checks if UUID of armor stand matches that of the book 9 | # 10 | scoreboard players set #as_success as_angle 0 11 | execute store success score #as_success as_angle run data modify storage customizable_armor_stands:book_storage SavedItem.tag.StatesUUID set from entity @e[type=armor_stand,sort=nearest,limit=1,tag=as_selected] UUID 12 | execute if score #as_success as_angle matches 1 run title @a[tag=as_selected,tag=!as_chat] actionbar [{"text":"Can't undo/redo state on current Armor Stand","color":"dark_green"}] 13 | execute if score #as_success as_angle matches 1 run tellraw @a[tag=as_selected,tag=as_chat] [{"text":" ","color":"dark_green"}, {"text":"Can't undo/redo state on current Armor Stand","color":"dark_green"}] 14 | # 15 | # Undo 16 | # 17 | execute as @s[scores={as_trigger=1200}] unless data storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[] if score #as_success as_angle matches 0 run title @a[tag=as_selected,tag=!as_chat] actionbar [{"text":"No states to undo","color":"dark_green"}] 18 | execute as @s[scores={as_trigger=1200}] unless data storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[] if score #as_success as_angle matches 0 run tellraw @a[tag=as_selected,tag=as_chat] [{"text":" ","color":"dark_green"}, {"text":"No states to undo","color":"dark_green"}] 19 | execute as @s[scores={as_trigger=1200}] if data storage customizable_armor_stands:book_storage SavedItem.tag.UndoStates[] if score #as_success as_angle matches 0 run function armor_statues:repeat/undo 20 | # 21 | # Redo 22 | # 23 | execute as @s[scores={as_trigger=1201}] unless data storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[] if score #as_success as_angle matches 0 run title @a[tag=as_selected,tag=!as_chat] actionbar [{"text":"No states to redo","color":"dark_green"}] 24 | execute as @s[scores={as_trigger=1201}] unless data storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[] if score #as_success as_angle matches 0 run tellraw @a[tag=as_selected,tag=as_chat] [{"text":" ","color":"dark_green"}, {"text":"No states to redo","color":"dark_green"}] 25 | execute as @s[scores={as_trigger=1201}] if data storage customizable_armor_stands:book_storage SavedItem.tag.RedoStates[] if score #as_success as_angle matches 0 run function armor_statues:repeat/redo -------------------------------------------------------------------------------- /data/armor_statues/functions/randomizer/body_angle.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: adjusts probability 3 | # Called by: armor_statues:randomizer/body 4 | # Entity @s: temp armor stand 5 | # 6 | scoreboard players set #x_negative as_angle 0 7 | scoreboard players set #y_negative as_angle 0 8 | scoreboard players set #z_negative as_angle 0 9 | scoreboard players set #random_type as_angle 0 10 | execute if predicate armor_statues:random_chance_10 run scoreboard players set #random_type as_angle 1 11 | execute if score #random_type as_angle matches 1 if predicate armor_statues:random_chance_30 run scoreboard players set #random_type as_angle 2 12 | # negative modulo 13 | execute if score #random_type as_angle matches 0..1 if score #x_angle as_angle matches ..-1 run scoreboard players set #x_negative as_angle 1 14 | execute if score #random_type as_angle matches 0..1 if score #y_angle as_angle matches ..-1 run scoreboard players set #y_negative as_angle 1 15 | execute if score #random_type as_angle matches 0..1 if score #z_angle as_angle matches ..-1 run scoreboard players set #z_negative as_angle 1 16 | execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle 17 | execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle 18 | execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle 19 | # small angle #random_type=0 20 | execute if score #random_type as_angle matches 0 run scoreboard players operation #x_angle as_angle %= #var15000 as_angle 21 | execute if score #random_type as_angle matches 0 run scoreboard players operation #y_angle as_angle %= #var15000 as_angle 22 | execute if score #random_type as_angle matches 0 run scoreboard players operation #z_angle as_angle %= #var15000 as_angle 23 | # med angle #random_type=1 24 | execute if score #random_type as_angle matches 1 run scoreboard players operation #x_angle as_angle %= #var30000 as_angle 25 | execute if score #random_type as_angle matches 1 run scoreboard players operation #y_angle as_angle %= #var30000 as_angle 26 | execute if score #random_type as_angle matches 1 run scoreboard players operation #z_angle as_angle %= #var30000 as_angle 27 | # extreme angle #random_type=2 (no modulo) 28 | # reversed negative 29 | execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle 30 | execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle 31 | execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle -------------------------------------------------------------------------------- /data/armor_statues/functions/randomizer/head_angle.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: adjusts probability 3 | # Called by: armor_statues:randomizer/head 4 | # Entity @s: temp armor stand 5 | # 6 | scoreboard players set #x_negative as_angle 0 7 | scoreboard players set #y_negative as_angle 0 8 | scoreboard players set #z_negative as_angle 0 9 | scoreboard players set #random_type as_angle 0 10 | execute if predicate armor_statues:random_chance_20 run scoreboard players set #random_type as_angle 1 11 | execute if score #random_type as_angle matches 1 if predicate armor_statues:random_chance_40 run scoreboard players set #random_type as_angle 2 12 | # negative modulo 13 | execute if score #random_type as_angle matches 0..1 if score #x_angle as_angle matches ..-1 run scoreboard players set #x_negative as_angle 1 14 | execute if score #random_type as_angle matches 0..1 if score #y_angle as_angle matches ..-1 run scoreboard players set #y_negative as_angle 1 15 | execute if score #random_type as_angle matches 0..1 if score #z_angle as_angle matches ..-1 run scoreboard players set #z_negative as_angle 1 16 | execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle 17 | execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle 18 | execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle 19 | # small angle #random_type=0 20 | execute if score #random_type as_angle matches 0 run scoreboard players operation #x_angle as_angle %= #var30000 as_angle 21 | execute if score #random_type as_angle matches 0 run scoreboard players operation #y_angle as_angle %= #var30000 as_angle 22 | execute if score #random_type as_angle matches 0 run scoreboard players operation #z_angle as_angle %= #var30000 as_angle 23 | # med angle #random_type=1 24 | execute if score #random_type as_angle matches 1 run scoreboard players operation #x_angle as_angle %= #var60000 as_angle 25 | execute if score #random_type as_angle matches 1 run scoreboard players operation #y_angle as_angle %= #var60000 as_angle 26 | execute if score #random_type as_angle matches 1 run scoreboard players operation #z_angle as_angle %= #var60000 as_angle 27 | # extreme angle #random_type=2 (no modulo) 28 | # reversed negative 29 | execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle 30 | execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle 31 | execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle -------------------------------------------------------------------------------- /data/armor_statues/functions/if_trigger.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Apply changes to nearest item frame according to the player's if_invisible score 3 | # Called by: armor_statues:second 4 | # Entity @s: player 5 | # 6 | # Tag the player and an item frame 1 block in front of their eyes 7 | # 8 | tag @s add as_selected 9 | execute anchored eyes positioned ^ ^ ^1 as @e[type=#armor_statues:item_frames,distance=..1,tag=!as_locked,sort=nearest,limit=1,nbt=!{Invulnerable:1b},nbt={Item:{Count:1b}}] unless entity @s[tag=!if_fixed,nbt={Fixed:1b}] run tag @s add as_selected 10 | # 11 | # Copy the trigger score to the selected item frame 12 | # 13 | scoreboard players operation @e[type=#armor_statues:item_frames,tag=as_selected] if_invisible = @s if_invisible 14 | # 15 | # Makes item frame 1 block in front of you invisible if it has an item 16 | # 17 | execute if entity @s[scores={if_invisible=1}] as @e[type=#armor_statues:item_frames,tag=as_selected,nbt=!{Invisible:1b}] run function armor_statues:item_frames/invisible 18 | # 19 | # Item frame fixing 20 | # 21 | # Creative 22 | execute if entity @s[scores={if_invisible=2..3},gamemode=creative] as @e[type=#armor_statues:item_frames,tag=as_selected] run function armor_statues:item_frames/fixed 23 | # Enabled 24 | execute if data storage customizable_armor_stands:settings as_admin{fixed_item_frame:"Enabled"} if entity @s[scores={if_invisible=2..3},gamemode=survival] as @e[type=#armor_statues:item_frames,tag=as_selected] run function armor_statues:item_frames/fixed 25 | # Disabled 26 | execute if data storage customizable_armor_stands:settings as_admin{fixed_item_frame:"Disabled"} if entity @s[scores={if_invisible=2..3},gamemode=survival] if entity @p[tag=as_selected,predicate=!armor_statues:mainhand_potion,predicate=!armor_statues:offhand_potion] run title @a[tag=as_selected,tag=!as_chat] actionbar [{"text":"Must be enabled from admin menu","color":"dark_red"}] 27 | execute if data storage customizable_armor_stands:settings as_admin{fixed_item_frame:"Disabled"} if entity @s[scores={if_invisible=2..3},gamemode=survival] if entity @p[tag=as_selected,predicate=!armor_statues:mainhand_potion,predicate=!armor_statues:offhand_potion] run tellraw @a[tag=as_selected,tag=as_chat] [{"text":" ","color":"dark_green"},{"text":"Must be enabled from admin menu","color":"dark_red"}] 28 | # 29 | # Reset item frame's trigger score and remove selected tag from player and item frame 30 | # 31 | scoreboard players reset @e[type=#armor_statues:item_frames,tag=as_selected] if_invisible 32 | tag @s remove as_selected 33 | tag @e[type=#armor_statues:item_frames,tag=as_selected] remove as_selected 34 | # 35 | # Reset player's trigger score and re-enable 36 | # 37 | scoreboard players set @s if_invisible 0 38 | scoreboard players enable @s if_invisible -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/position_relative.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Nudge postion of armor stand relative to the player 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor stand 5 | # 6 | # Summons temp armor stand 7 | summon minecraft:armor_stand ~ ~ ~ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b} 8 | tp @e[type=armor_stand,tag=as_temp_armor_stand] ~ ~ ~ facing entity @p[tag=as_selected] 9 | # 10 | # stores temp armor stand angle 11 | # 12 | execute if entity @p[tag=as_selected,scores={as_trigger=1100..1111}] store result score #temp_rotation as_pose run data get entity @e[type=armor_stand,tag=as_temp_armor_stand,limit=1] Rotation[0] 13 | # Facing south 14 | execute if entity @p[tag=as_selected,scores={as_trigger=1100..1111}] if score #temp_rotation as_pose matches -45..45 rotated 0 0 run function armor_statues:relative_position_aligned_nudge 15 | execute if entity @p[tag=as_selected,scores={as_trigger=1100..1111}] if score #temp_rotation as_pose matches 316..360 rotated 0 0 run function armor_statues:relative_position_aligned_nudge 16 | execute if entity @p[tag=as_selected,scores={as_trigger=1100..1111}] if score #temp_rotation as_pose matches -360..-316 rotated 0 0 run function armor_statues:relative_position_aligned_nudge 17 | # Facing West 18 | execute if entity @p[tag=as_selected,scores={as_trigger=1100..1111}] if score #temp_rotation as_pose matches 46..135 rotated 90 0 run function armor_statues:relative_position_aligned_nudge 19 | execute if entity @p[tag=as_selected,scores={as_trigger=1100..1111}] if score #temp_rotation as_pose matches -315..-226 rotated 90 0 run function armor_statues:relative_position_aligned_nudge 20 | # Facing North 21 | execute if entity @p[tag=as_selected,scores={as_trigger=1100..1111}] if score #temp_rotation as_pose matches 136..225 rotated 180 0 run function armor_statues:relative_position_aligned_nudge 22 | execute if entity @p[tag=as_selected,scores={as_trigger=1100..1111}] if score #temp_rotation as_pose matches -225..-136 rotated 180 0 run function armor_statues:relative_position_aligned_nudge 23 | # Facing East 24 | execute if entity @p[tag=as_selected,scores={as_trigger=1100..1111}] if score #temp_rotation as_pose matches 226..315 rotated 270 0 run function armor_statues:relative_position_aligned_nudge 25 | execute if entity @p[tag=as_selected,scores={as_trigger=1100..1111}] if score #temp_rotation as_pose matches -135..-46 rotated 270 0 run function armor_statues:relative_position_aligned_nudge 26 | # 27 | # Relative nudge from player function 28 | # 29 | execute if entity @p[tag=as_selected,scores={as_trigger=1112..1129}] rotated as @e[type=armor_stand,tag=as_temp_armor_stand] run function armor_statues:relative_position_nudge 30 | # 31 | # Kills temp armor stand 32 | # 33 | kill @e[type=armor_stand,tag=as_temp_armor_stand] 34 | # 35 | # Tag the armor stand as modified 36 | # 37 | tag @s add as_modified 38 | -------------------------------------------------------------------------------- /data/armor_statues/functions/randomizer/left_leg_angle.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: adjusts probability 3 | # Called by: armor_statues:randomizer/left_leg 4 | # Entity @s: temp armor stand 5 | # 6 | scoreboard players set #x_negative as_angle 0 7 | scoreboard players set #y_negative as_angle 0 8 | scoreboard players set #z_negative as_angle 0 9 | scoreboard players set #random_type as_angle 0 10 | execute if predicate armor_statues:random_chance_30 run scoreboard players set #random_type as_angle 1 11 | execute if score #random_type as_angle matches 1 if predicate armor_statues:random_chance_50 run scoreboard players set #random_type as_angle 2 12 | # crossing reduction 13 | scoreboard players set #no_crossing as_angle 0 14 | execute if predicate armor_statues:random_chance_85 run scoreboard players set #no_crossing as_angle 1 15 | #execute if score #no_crossing as_angle matches 1 if score #x_angle as_angle matches 10000..170000 run scoreboard players operation #x_angle as_angle -= #var180000 as_angle 16 | execute if score #no_crossing as_angle matches 1 if score #y_angle as_angle matches 10000..170000 run scoreboard players operation #y_angle as_angle -= #var180000 as_angle 17 | execute if score #no_crossing as_angle matches 1 if score #z_angle as_angle matches 10000..170000 run scoreboard players operation #z_angle as_angle -= #var180000 as_angle 18 | # negative modulo 19 | execute if score #random_type as_angle matches 0..1 if score #x_angle as_angle matches ..-1 run scoreboard players set #x_negative as_angle 1 20 | execute if score #random_type as_angle matches 0..1 if score #y_angle as_angle matches ..-1 run scoreboard players set #y_negative as_angle 1 21 | execute if score #random_type as_angle matches 0..1 if score #z_angle as_angle matches ..-1 run scoreboard players set #z_negative as_angle 1 22 | execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle 23 | execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle 24 | execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle 25 | # small angle #random_type=0 26 | execute if score #random_type as_angle matches 0 run scoreboard players operation #x_angle as_angle %= #var45000 as_angle 27 | execute if score #random_type as_angle matches 0 run scoreboard players operation #y_angle as_angle %= #var45000 as_angle 28 | execute if score #random_type as_angle matches 0 run scoreboard players operation #z_angle as_angle %= #var45000 as_angle 29 | # med angle #random_type=1 30 | execute if score #random_type as_angle matches 1 run scoreboard players operation #x_angle as_angle %= #var90000 as_angle 31 | execute if score #random_type as_angle matches 1 run scoreboard players operation #y_angle as_angle %= #var90000 as_angle 32 | execute if score #random_type as_angle matches 1 run scoreboard players operation #z_angle as_angle %= #var90000 as_angle 33 | # extreme angle #random_type=2 (no modulo) 34 | # reversed negative 35 | execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle 36 | execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle 37 | execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle -------------------------------------------------------------------------------- /data/armor_statues/functions/randomizer/right_leg_angle.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: adjusts probability 3 | # Called by: armor_statues:randomizer/right_leg 4 | # Entity @s: temp armor stand 5 | # 6 | scoreboard players set #x_negative as_angle 0 7 | scoreboard players set #y_negative as_angle 0 8 | scoreboard players set #z_negative as_angle 0 9 | scoreboard players set #random_type as_angle 0 10 | execute if predicate armor_statues:random_chance_30 run scoreboard players set #random_type as_angle 1 11 | execute if score #random_type as_angle matches 1 if predicate armor_statues:random_chance_50 run scoreboard players set #random_type as_angle 2 12 | # crossing reduction 13 | scoreboard players set #no_crossing as_angle 0 14 | execute if predicate armor_statues:random_chance_85 run scoreboard players set #no_crossing as_angle 1 15 | #execute if score #no_crossing as_angle matches 1 if score #x_angle as_angle matches -170000..-10000 run scoreboard players operation #x_angle as_angle += #var180000 as_angle 16 | execute if score #no_crossing as_angle matches 1 if score #y_angle as_angle matches -170000..-10000 run scoreboard players operation #y_angle as_angle += #var180000 as_angle 17 | execute if score #no_crossing as_angle matches 1 if score #z_angle as_angle matches -170000..-10000 run scoreboard players operation #z_angle as_angle += #var180000 as_angle 18 | # negative modulo 19 | execute if score #random_type as_angle matches 0..1 if score #x_angle as_angle matches ..-1 run scoreboard players set #x_negative as_angle 1 20 | execute if score #random_type as_angle matches 0..1 if score #y_angle as_angle matches ..-1 run scoreboard players set #y_negative as_angle 1 21 | execute if score #random_type as_angle matches 0..1 if score #z_angle as_angle matches ..-1 run scoreboard players set #z_negative as_angle 1 22 | execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle 23 | execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle 24 | execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle 25 | # small angle #random_type=0 26 | execute if score #random_type as_angle matches 0 run scoreboard players operation #x_angle as_angle %= #var45000 as_angle 27 | execute if score #random_type as_angle matches 0 run scoreboard players operation #y_angle as_angle %= #var45000 as_angle 28 | execute if score #random_type as_angle matches 0 run scoreboard players operation #z_angle as_angle %= #var45000 as_angle 29 | # med angle #random_type=1 30 | execute if score #random_type as_angle matches 1 run scoreboard players operation #x_angle as_angle %= #var90000 as_angle 31 | execute if score #random_type as_angle matches 1 run scoreboard players operation #y_angle as_angle %= #var90000 as_angle 32 | execute if score #random_type as_angle matches 1 run scoreboard players operation #z_angle as_angle %= #var90000 as_angle 33 | # extreme angle #random_type=2 (no modulo) 34 | # reversed negative 35 | execute if score #x_negative as_angle matches 1 run scoreboard players operation #x_angle as_angle *= #var-1 as_angle 36 | execute if score #y_negative as_angle matches 1 run scoreboard players operation #y_angle as_angle *= #var-1 as_angle 37 | execute if score #z_negative as_angle matches 1 run scoreboard players operation #z_angle as_angle *= #var-1 as_angle -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/flip.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Flip armor stand's pose left to right 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor stand 5 | # 6 | # Apply bugfix for MC-80975 7 | # 8 | function armor_statues:bugfix 9 | # 10 | # Arms 11 | # 12 | execute store result score #as_temp as_pose run data get entity @s Pose.RightArm[0] 1000 13 | execute store result score @s as_pose run data get entity @s Pose.LeftArm[0] 1000 14 | execute store result entity @s Pose.RightArm[0] float 0.001 run scoreboard players get @s as_pose 15 | execute store result entity @s Pose.LeftArm[0] float 0.001 run scoreboard players get #as_temp as_pose 16 | # 17 | execute store result score #as_temp as_pose run data get entity @s Pose.RightArm[1] -1000 18 | execute store result score @s as_pose run data get entity @s Pose.LeftArm[1] -1000 19 | execute store result entity @s Pose.RightArm[1] float 0.001 run scoreboard players get @s as_pose 20 | execute store result entity @s Pose.LeftArm[1] float 0.001 run scoreboard players get #as_temp as_pose 21 | # 22 | execute store result score #as_temp as_pose run data get entity @s Pose.RightArm[2] -1000 23 | execute store result score @s as_pose run data get entity @s Pose.LeftArm[2] -1000 24 | execute store result entity @s Pose.RightArm[2] float 0.001 run scoreboard players get @s as_pose 25 | execute store result entity @s Pose.LeftArm[2] float 0.001 run scoreboard players get #as_temp as_pose 26 | # 27 | # Legs 28 | # 29 | execute store result score #as_temp as_pose run data get entity @s Pose.RightLeg[0] 1000 30 | execute store result score @s as_pose run data get entity @s Pose.LeftLeg[0] 1000 31 | execute store result entity @s Pose.RightLeg[0] float 0.001 run scoreboard players get @s as_pose 32 | execute store result entity @s Pose.LeftLeg[0] float 0.001 run scoreboard players get #as_temp as_pose 33 | # 34 | execute store result score #as_temp as_pose run data get entity @s Pose.RightLeg[1] -1000 35 | execute store result score @s as_pose run data get entity @s Pose.LeftLeg[1] -1000 36 | execute store result entity @s Pose.RightLeg[1] float 0.001 run scoreboard players get @s as_pose 37 | execute store result entity @s Pose.LeftLeg[1] float 0.001 run scoreboard players get #as_temp as_pose 38 | # 39 | execute store result score #as_temp as_pose run data get entity @s Pose.RightLeg[2] -1000 40 | execute store result score @s as_pose run data get entity @s Pose.LeftLeg[2] -1000 41 | execute store result entity @s Pose.RightLeg[2] float 0.001 run scoreboard players get @s as_pose 42 | execute store result entity @s Pose.LeftLeg[2] float 0.001 run scoreboard players get #as_temp as_pose 43 | # 44 | # Head 45 | # 46 | execute store result score @s as_pose run data get entity @s Pose.Head[1] -1000 47 | execute store result entity @s Pose.Head[1] float 0.001 run scoreboard players get @s as_pose 48 | execute store result score @s as_pose run data get entity @s Pose.Head[2] -1000 49 | execute store result entity @s Pose.Head[2] float 0.001 run scoreboard players get @s as_pose 50 | # 51 | # Body 52 | # 53 | execute store result score @s as_pose run data get entity @s Pose.Body[1] -1000 54 | execute store result entity @s Pose.Body[1] float 0.001 run scoreboard players get @s as_pose 55 | execute store result score @s as_pose run data get entity @s Pose.Body[2] -1000 56 | execute store result entity @s Pose.Body[2] float 0.001 run scoreboard players get @s as_pose 57 | # 58 | # Clear temporary dummy player 59 | # 60 | scoreboard players reset #as_temp as_pose 61 | # 62 | # Tag the armor stand as modified 63 | # 64 | tag @s add as_modified 65 | -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/mirror.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Mirror armor stand's arms or legs 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor stand 5 | # 6 | # Apply bugfix for MC-80975 7 | # 8 | function armor_statues:bugfix 9 | # 10 | # Mirror arms left to right 11 | # 12 | execute if entity @s[scores={as_trigger=131}] store result score @s as_pose run data get entity @s Pose.LeftArm[0] 1000 13 | execute if entity @s[scores={as_trigger=131}] store result entity @s Pose.RightArm[0] float 0.001 run scoreboard players get @s as_pose 14 | execute if entity @s[scores={as_trigger=131}] store result score @s as_pose run data get entity @s Pose.LeftArm[1] -1000 15 | execute if entity @s[scores={as_trigger=131}] store result entity @s Pose.RightArm[1] float 0.001 run scoreboard players get @s as_pose 16 | execute if entity @s[scores={as_trigger=131}] store result score @s as_pose run data get entity @s Pose.LeftArm[2] -1000 17 | execute if entity @s[scores={as_trigger=131}] store result entity @s Pose.RightArm[2] float 0.001 run scoreboard players get @s as_pose 18 | # 19 | # Mirror arms right to left 20 | # 21 | execute if entity @s[scores={as_trigger=132}] store result score @s as_pose run data get entity @s Pose.RightArm[0] 1000 22 | execute if entity @s[scores={as_trigger=132}] store result entity @s Pose.LeftArm[0] float 0.001 run scoreboard players get @s as_pose 23 | execute if entity @s[scores={as_trigger=132}] store result score @s as_pose run data get entity @s Pose.RightArm[1] -1000 24 | execute if entity @s[scores={as_trigger=132}] store result entity @s Pose.LeftArm[1] float 0.001 run scoreboard players get @s as_pose 25 | execute if entity @s[scores={as_trigger=132}] store result score @s as_pose run data get entity @s Pose.RightArm[2] -1000 26 | execute if entity @s[scores={as_trigger=132}] store result entity @s Pose.LeftArm[2] float 0.001 run scoreboard players get @s as_pose 27 | # 28 | # Mirror legs left to right 29 | # 30 | execute if entity @s[scores={as_trigger=133}] store result score @s as_pose run data get entity @s Pose.LeftLeg[0] 1000 31 | execute if entity @s[scores={as_trigger=133}] store result entity @s Pose.RightLeg[0] float 0.001 run scoreboard players get @s as_pose 32 | execute if entity @s[scores={as_trigger=133}] store result score @s as_pose run data get entity @s Pose.LeftLeg[1] -1000 33 | execute if entity @s[scores={as_trigger=133}] store result entity @s Pose.RightLeg[1] float 0.001 run scoreboard players get @s as_pose 34 | execute if entity @s[scores={as_trigger=133}] store result score @s as_pose run data get entity @s Pose.LeftLeg[2] -1000 35 | execute if entity @s[scores={as_trigger=133}] store result entity @s Pose.RightLeg[2] float 0.001 run scoreboard players get @s as_pose 36 | # 37 | # Mirror legs right to left 38 | # 39 | execute if entity @s[scores={as_trigger=134}] store result score @s as_pose run data get entity @s Pose.RightLeg[0] 1000 40 | execute if entity @s[scores={as_trigger=134}] store result entity @s Pose.LeftLeg[0] float 0.001 run scoreboard players get @s as_pose 41 | execute if entity @s[scores={as_trigger=134}] store result score @s as_pose run data get entity @s Pose.RightLeg[1] -1000 42 | execute if entity @s[scores={as_trigger=134}] store result entity @s Pose.LeftLeg[1] float 0.001 run scoreboard players get @s as_pose 43 | execute if entity @s[scores={as_trigger=134}] store result score @s as_pose run data get entity @s Pose.RightLeg[2] -1000 44 | execute if entity @s[scores={as_trigger=134}] store result entity @s Pose.LeftLeg[2] float 0.001 run scoreboard players get @s as_pose 45 | # 46 | # Tag the armor stand as modified 47 | # 48 | tag @s add as_modified 49 | -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/rack.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Align stand with tripwire hook to make a tool rack 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor stand 5 | # 6 | # Turn off gravity for armor stand 7 | # 8 | data merge entity @s {NoGravity:1b} 9 | # 10 | # Check for an tripwire hook in the blocks above the stand and, if found, move the stand into position below the hook and tag it 11 | # 12 | execute at @s align xyz positioned ~0.5 ~ ~0.5 if block ~ ~1 ~ minecraft:tripwire_hook run tp @s ~ ~ ~ 13 | execute at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack 14 | execute if entity @s[tag=!as_rack] at @s align xyz positioned ~0.5 ~1 ~0.5 if block ~ ~1 ~ minecraft:tripwire_hook run tp @s ~ ~ ~ 15 | execute if entity @s[tag=!as_rack] at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack 16 | execute if entity @s[tag=!as_rack] at @s align xyz positioned ~0.5 ~2 ~0.5 if block ~ ~1 ~ minecraft:tripwire_hook run tp @s ~ ~ ~ 17 | execute if entity @s[tag=!as_rack] at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack 18 | # 19 | # If there is a tripwire hook above the armor stand, rotate the stand to match it's orientation 20 | # 21 | execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=north] run data merge entity @s {Rotation:[180.0f,0.0f]} 22 | execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=east] run data merge entity @s {Rotation:[-90.0f,0.0f]} 23 | execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=south] run data merge entity @s {Rotation:[0.0f,0.0f]} 24 | execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=west] run data merge entity @s {Rotation:[90.0f,0.0f]} 25 | # 26 | # If armor stand is not tagged, display failure message 27 | # 28 | execute if entity @s[tag=!as_rack] run title @a[tag=as_selected,tag=!as_chat] actionbar [{"text":"Tripwire hook not found","color":"dark_red"}] 29 | execute if entity @s[tag=!as_rack] run tellraw @a[tag=as_selected,tag=as_chat] [{"text":" ","color":"dark_green"},{"text":"Tripwire hook not found","color":"dark_red"}] 30 | # 31 | # Otherwise, adjust the armor stand pose and settings, disabling all slots but the main hand, and move it into place 32 | # 33 | execute if entity @s[tag=as_rack,scores={as_trigger=155}] run data merge entity @s {ShowArms:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-100.0f,90.0f,180.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]},DisabledSlots:4079166} 34 | execute if entity @s[tag=as_rack,scores={as_trigger=155}] at @s run tp @s ^-0.17 ^0.24 ^-0.05 35 | # 36 | # Tag the armor stand as modified 37 | # 38 | execute if entity @s[tag=as_rack] run tag @s add as_modified 39 | # 40 | # Also, mark as locked 41 | # 42 | execute if entity @s[tag=as_rack] run tag @s add as_locked 43 | # 44 | # add Player UUID lock 45 | # 46 | execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid1 run data get entity @p[tag=as_selected] UUID[0] 47 | execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid2 run data get entity @p[tag=as_selected] UUID[1] 48 | execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid3 run data get entity @p[tag=as_selected] UUID[2] 49 | 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] 50 | execute if entity @s[tag=as_rack] run tag @s add as_uuid_locked 51 | # 52 | # add tool rack tag 53 | # 54 | execute if entity @s[tag=as_rack] run tag @s add as_tool_rack 55 | execute if entity @s[tag=as_rack] run tag @s add as_invisible 56 | # 57 | # Finally, remove the as_rack tag 58 | # 59 | execute if entity @s[tag=as_rack] run tag @s remove as_rack 60 | -------------------------------------------------------------------------------- /data/armor_statues/functions/trigger/rack_small.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Align stand with tripwire hook to make a tool rack for small armor stands 3 | # Called by: armor_statues:trigger 4 | # Entity @s: armor stand 5 | # 6 | # Turn off gravity for armor stand 7 | # 8 | data merge entity @s {NoGravity:1b} 9 | # 10 | # Check for an tripwire hook in the blocks above the stand and, if found, move the stand into position below the hook and tag it 11 | # 12 | execute at @s align xyz positioned ~0.5 ~ ~0.5 if block ~ ~1 ~ minecraft:tripwire_hook run tp @s ~ ~ ~ 13 | execute at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack 14 | execute if entity @s[tag=!as_rack] at @s align xyz positioned ~0.5 ~1 ~0.5 if block ~ ~1 ~ minecraft:tripwire_hook run tp @s ~ ~ ~ 15 | execute if entity @s[tag=!as_rack] at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack 16 | execute if entity @s[tag=!as_rack] at @s align xyz positioned ~0.5 ~2 ~0.5 if block ~ ~1 ~ minecraft:tripwire_hook run tp @s ~ ~ ~ 17 | execute if entity @s[tag=!as_rack] at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack 18 | # 19 | # If there is a tripwire hook above the armor stand, rotate the stand to match it's orientation 20 | # 21 | execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=north] run data merge entity @s {Rotation:[180.0f,0.0f]} 22 | execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=east] run data merge entity @s {Rotation:[-90.0f,0.0f]} 23 | execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=south] run data merge entity @s {Rotation:[0.0f,0.0f]} 24 | execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=west] run data merge entity @s {Rotation:[90.0f,0.0f]} 25 | # 26 | # If armor stand is not tagged, display failure message 27 | # 28 | execute if entity @s[tag=!as_rack] run title @a[tag=as_selected,tag=!as_chat] actionbar [{"text":"Tripwire hook not found","color":"dark_red"}] 29 | execute if entity @s[tag=!as_rack] run tellraw @a[tag=as_selected,tag=as_chat] [{"text":" ","color":"dark_green"},{"text":"Tripwire hook not found","color":"dark_red"}] 30 | # 31 | # Otherwise, adjust the armor stand pose and settings, disabling all slots but the main hand, and move it into place 32 | # 33 | execute if entity @s[tag=as_rack,scores={as_trigger=155}] run data merge entity @s {ShowArms:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-100.0f,90.0f,180.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]},DisabledSlots:4079166} 34 | execute if entity @s[tag=as_rack,scores={as_trigger=155}] at @s run tp @s ^-0.085 ^0.87 ^-0.05 35 | # 36 | # Tag the armor stand as modified 37 | # 38 | execute if entity @s[tag=as_rack] run tag @s add as_modified 39 | # 40 | # Also, mark as locked 41 | # 42 | execute if entity @s[tag=as_rack] run tag @s add as_locked 43 | # 44 | # add Player UUID lock 45 | # 46 | execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid1 run data get entity @p[tag=as_selected] UUID[0] 47 | execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid2 run data get entity @p[tag=as_selected] UUID[1] 48 | execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid3 run data get entity @p[tag=as_selected] UUID[2] 49 | 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] 50 | execute if entity @s[tag=as_rack] run tag @s add as_uuid_locked 51 | # 52 | # add tool rack tag 53 | # 54 | execute if entity @s[tag=as_rack] run tag @s add as_tool_rack 55 | execute if entity @s[tag=as_rack] run tag @s add as_invisible 56 | # 57 | # Finally, remove the as_rack tag 58 | # 59 | execute if entity @s[tag=as_rack] run tag @s remove as_rack 60 | -------------------------------------------------------------------------------- /data/armor_statues/functions/admin.mcfunction: -------------------------------------------------------------------------------- 1 | # 2 | # Description: Display admin options in chat 3 | # Called by: Player 4 | # Entity @s: Player 5 | # 6 | tellraw @s [{"text":"Customizable Armor Stands - Admin Options","color":"yellow","bold":"true"}] 7 | tellraw @s [{"text":"Particle shrine: ","color":"aqua"},{"text":"Create","color":"green","clickEvent":{"action":"run_command","value":"/function armor_statues:shrine/create"}},{"text":" / ","color":"aqua"},{"text":"Remove","color":"green","clickEvent":{"action":"run_command","value":"/function armor_statues:shrine/remove"}}] 8 | tellraw @s [{"text":"Get book from help: ","color":"aqua"},{"storage":"customizable_armor_stands:settings", "nbt":"as_admin.book_help", "color":"green", "clickEvent":{"action":"run_command", "value":"/function armor_statues:admin/book_from_help_toggle"}, "hoverEvent":{"action":"show_text", "contents":{"text":"Click to toggle", "color":"yellow"}}}] 9 | tellraw @s [{"text":"Craftable book: ","color":"aqua"},{"storage":"customizable_armor_stands:settings", "nbt":"as_admin.book_craft", "color":"green", "clickEvent":{"action":"run_command", "value":"/function armor_statues:admin/craft_book_toggle"}, "hoverEvent":{"action":"show_text", "contents":{"text":"Click to toggle", "color":"yellow"}}}] 10 | tellraw @s [{"text":"UUID locked Armor Stands: ","color":"aqua"},{"storage":"customizable_armor_stands:settings", "nbt":"as_admin.uuid_lock", "color":"green", "clickEvent":{"action":"run_command", "value":"/function armor_statues:admin/uuid_lock_toggle"}, "hoverEvent":{"action":"show_text", "contents":{"text":"Makes locked armor stands only unlockable by the player who locked them or creative players.\\n\\nClick to toggle", "color":"yellow"}}}] 11 | tellraw @s [{"text":"Enable Item Frame Fixing: ","color":"aqua"},{"storage":"customizable_armor_stands:settings", "nbt":"as_admin.fixed_item_frame", "color":"green", "clickEvent":{"action":"run_command", "value":"/function armor_statues:admin/fixed_item_frame_toggle"}, "hoverEvent":{"action":"show_text", "contents":{"text":"Click to toggle", "color":"yellow"}}}] 12 | # 13 | tellraw @s [{"text":"Delete unused invisible stands","color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"Deletes any invisible armor stands in loaded chunks that are not holding or wearing any items.","color":"yellow"}]},"clickEvent":{"action":"run_command","value":"/function armor_statues:admin/unused"}}] 14 | tellraw @s [{"text":"Highlight all stands","color":"green","hoverEvent":{"action":"show_text","contents":[{"text":"Gives all stands within 64 blocks the glowing effect for 15 seconds","color":"yellow"}]},"clickEvent":{"action":"run_command","value":"/effect give @e[type=armor_stand,distance=..64] minecraft:glowing 15 1 true"}}] 15 | # 16 | tellraw @s [{"text":"Max Undo States: ","color":"aqua","hoverEvent":{"action":"show_text","contents":[{"text":"Sets the maximum number of undo states savable to the Armor Statues book.\nSet to 0 to disable undo states.","color":"yellow"}]},"clickEvent":{"action":"suggest_command","value":"/scoreboard players set #undo_states as_angle