mirror of
https://github.com/LZStealth/armor-statues.git
synced 2025-08-10 20:45:53 +01:00
Initial commit for armor statues
This commit is contained in:
121
data/armor_statues/functions/trigger/adjust.mcfunction
Normal file
121
data/armor_statues/functions/trigger/adjust.mcfunction
Normal file
@@ -0,0 +1,121 @@
|
||||
#
|
||||
# Description: Adjust armor stand pose
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Apply bugfix for MC-80975
|
||||
#
|
||||
function armor_statues:bugfix
|
||||
#
|
||||
# Get angle step from player and scale by 1000
|
||||
#
|
||||
scoreboard players operation @s as_angle = @p as_angle
|
||||
scoreboard players set #as_temp as_angle 1000
|
||||
scoreboard players operation @s as_angle *= #as_temp as_angle
|
||||
scoreboard players reset #as_temp as_angle
|
||||
#
|
||||
# Head: 60-65
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=60..61}] store result score @s as_pose run data get entity @s Pose.Head[0] 1000
|
||||
execute if entity @s[scores={as_trigger=60}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=61}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=60..61}] store result entity @s Pose.Head[0] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=62..63}] store result score @s as_pose run data get entity @s Pose.Head[1] 1000
|
||||
execute if entity @s[scores={as_trigger=62}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=63}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=62..63}] store result entity @s Pose.Head[1] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=64..65}] store result score @s as_pose run data get entity @s Pose.Head[2] 1000
|
||||
execute if entity @s[scores={as_trigger=64}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=65}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=64..65}] store result entity @s Pose.Head[2] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
# Body: 66-71
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=66..67}] store result score @s as_pose run data get entity @s Pose.Body[0] 1000
|
||||
execute if entity @s[scores={as_trigger=66}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=67}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=66..67}] store result entity @s Pose.Body[0] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=68..69}] store result score @s as_pose run data get entity @s Pose.Body[1] 1000
|
||||
execute if entity @s[scores={as_trigger=68}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=69}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=68..69}] store result entity @s Pose.Body[1] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=70..71}] store result score @s as_pose run data get entity @s Pose.Body[2] 1000
|
||||
execute if entity @s[scores={as_trigger=70}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=71}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=70..71}] store result entity @s Pose.Body[2] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
# Right Arm: 72-77
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=72..73}] store result score @s as_pose run data get entity @s Pose.RightArm[0] 1000
|
||||
execute if entity @s[scores={as_trigger=72}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=73}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=72..73}] store result entity @s Pose.RightArm[0] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=74..75}] store result score @s as_pose run data get entity @s Pose.RightArm[1] 1000
|
||||
execute if entity @s[scores={as_trigger=74}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=75}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=74..75}] store result entity @s Pose.RightArm[1] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=76..77}] store result score @s as_pose run data get entity @s Pose.RightArm[2] 1000
|
||||
execute if entity @s[scores={as_trigger=76}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=77}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=76..77}] store result entity @s Pose.RightArm[2] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
# Left Arm: 78-83
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=78..79}] store result score @s as_pose run data get entity @s Pose.LeftArm[0] 1000
|
||||
execute if entity @s[scores={as_trigger=78}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=79}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=78..79}] store result entity @s Pose.LeftArm[0] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=80..81}] store result score @s as_pose run data get entity @s Pose.LeftArm[1] 1000
|
||||
execute if entity @s[scores={as_trigger=80}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=81}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=80..81}] store result entity @s Pose.LeftArm[1] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=82..83}] store result score @s as_pose run data get entity @s Pose.LeftArm[2] 1000
|
||||
execute if entity @s[scores={as_trigger=82}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=83}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=82..83}] store result entity @s Pose.LeftArm[2] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
# Right Leg: 84-89
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=84..85}] store result score @s as_pose run data get entity @s Pose.RightLeg[0] 1000
|
||||
execute if entity @s[scores={as_trigger=84}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=85}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=84..85}] store result entity @s Pose.RightLeg[0] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=86..87}] store result score @s as_pose run data get entity @s Pose.RightLeg[1] 1000
|
||||
execute if entity @s[scores={as_trigger=86}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=87}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=86..87}] store result entity @s Pose.RightLeg[1] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=88..89}] store result score @s as_pose run data get entity @s Pose.RightLeg[2] 1000
|
||||
execute if entity @s[scores={as_trigger=88}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=89}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=88..89}] store result entity @s Pose.RightLeg[2] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
# Left Leg: 90-95
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=90..91}] store result score @s as_pose run data get entity @s Pose.LeftLeg[0] 1000
|
||||
execute if entity @s[scores={as_trigger=90}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=91}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=90..91}] store result entity @s Pose.LeftLeg[0] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=92..93}] store result score @s as_pose run data get entity @s Pose.LeftLeg[1] 1000
|
||||
execute if entity @s[scores={as_trigger=92}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=93}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=92..93}] store result entity @s Pose.LeftLeg[1] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=94..95}] store result score @s as_pose run data get entity @s Pose.LeftLeg[2] 1000
|
||||
execute if entity @s[scores={as_trigger=94}] run scoreboard players operation @s as_pose += @s as_angle
|
||||
execute if entity @s[scores={as_trigger=95}] run scoreboard players operation @s as_pose -= @s as_angle
|
||||
execute if entity @s[scores={as_trigger=94..95}] store result entity @s Pose.LeftLeg[2] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
28
data/armor_statues/functions/trigger/align.mcfunction
Normal file
28
data/armor_statues/functions/trigger/align.mcfunction
Normal file
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# Description: Align held block or item with supporting surface
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Align block to surface
|
||||
#
|
||||
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]}}
|
||||
execute if entity @s[scores={as_trigger=151}] at @s run tp @s ^0.5725 ^-0.655 ^0.352
|
||||
#
|
||||
# Align item to surface (upright)
|
||||
#
|
||||
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]}}
|
||||
execute if entity @s[scores={as_trigger=152}] at @s run tp @s ^0.36 ^-1.41 ^-0.5625
|
||||
#
|
||||
# Align item to surface (flat)
|
||||
#
|
||||
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]}}
|
||||
execute if entity @s[scores={as_trigger=153}] at @s run tp @s ^0.385 ^-0.78 ^-0.295
|
||||
#
|
||||
# Align tool to surface (flat)
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=154}] run data merge entity @s {ShowArms:1b,NoGravity:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-10.0f,0.0f,-90.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=154}] at @s run tp @s ^-0.17 ^-1.285 ^-0.44
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
28
data/armor_statues/functions/trigger/align_small.mcfunction
Normal file
28
data/armor_statues/functions/trigger/align_small.mcfunction
Normal file
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# Description: Align held block or item with supporting surface for small armor stands
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Align block to surface
|
||||
#
|
||||
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]}}
|
||||
execute if entity @s[scores={as_trigger=151}] at @s run tp @s ^0.28625 ^-0.3275 ^0.176
|
||||
#
|
||||
# Align item to surface (upright)
|
||||
#
|
||||
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]}}
|
||||
execute if entity @s[scores={as_trigger=152}] at @s run tp @s ^0.18 ^-0.705 ^-0.28125
|
||||
#
|
||||
# Align item to surface (flat)
|
||||
#
|
||||
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]}}
|
||||
execute if entity @s[scores={as_trigger=153}] at @s run tp @s ^0.1925 ^-0.39 ^-0.1475
|
||||
#
|
||||
# Align tool to surface (flat)
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=154}] run data merge entity @s {ShowArms:1b,NoGravity:1b,Invisible:1b,Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-10.0f,0.0f,-90.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=154}] at @s run tp @s ^-0.085 ^-0.6425 ^-0.22
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
21
data/armor_statues/functions/trigger/copy.mcfunction
Normal file
21
data/armor_statues/functions/trigger/copy.mcfunction
Normal file
@@ -0,0 +1,21 @@
|
||||
#
|
||||
# Description: Copies selected armor stand settings and pose to the book
|
||||
# Called by: as_statue:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
execute as @p[tag=as_selected] run function armor_statues:storage_in
|
||||
#
|
||||
data modify storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose set value {Pose:{}, NoBasePlate:0b, ShowArms:0b, Small:0b, Invisible:0b, CustomNameVisible:0b}
|
||||
#
|
||||
data modify storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose.Pose set from entity @s Pose
|
||||
data modify storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose.NoBasePlate set from entity @s NoBasePlate
|
||||
data modify storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose.ShowArms set from entity @s ShowArms
|
||||
data modify storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose.Small set from entity @s Small
|
||||
data modify storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose.Invisible set from entity @s Invisible
|
||||
data modify storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose.CustomNameVisible set from entity @s CustomNameVisible
|
||||
#
|
||||
execute as @p[tag=as_selected] run function armor_statues:storage_out_copy
|
||||
#
|
||||
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"}]
|
||||
tellraw @a[tag=as_selected,tag=as_chat] [{"text":"<Stick_God> ","color":"dark_green"}, {"selector":"@s","color":"dark_green"}, {"text":" Pose and settings copied to the book","color":"dark_green"}]
|
||||
effect give @s minecraft:glowing 1
|
20
data/armor_statues/functions/trigger/facing.mcfunction
Normal file
20
data/armor_statues/functions/trigger/facing.mcfunction
Normal file
@@ -0,0 +1,20 @@
|
||||
#
|
||||
# Description: Adjust rotation of armor stand
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Note: The function is being executed at the location of the armor stand so @p is not necessarily the original player
|
||||
#
|
||||
# Rotate the armor stand to face the selected player
|
||||
#
|
||||
tp @s ~ ~ ~ facing entity @a[distance=..3,tag=as_selected,limit=1]
|
||||
#
|
||||
# If stand is required to face away from the player, add 180 to the rotation
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=125}] store result score @s as_pose run data get entity @s Rotation[0] 1
|
||||
execute if entity @s[scores={as_trigger=125}] run scoreboard players add @s as_pose 180
|
||||
execute if entity @s[scores={as_trigger=125}] store result entity @s Rotation[0] float 1 run scoreboard players get @s as_pose
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
64
data/armor_statues/functions/trigger/flip.mcfunction
Normal file
64
data/armor_statues/functions/trigger/flip.mcfunction
Normal file
@@ -0,0 +1,64 @@
|
||||
#
|
||||
# Description: Flip armor stand's pose left to right
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Apply bugfix for MC-80975
|
||||
#
|
||||
function armor_statues:bugfix
|
||||
#
|
||||
# Arms
|
||||
#
|
||||
execute store result score #as_temp as_pose run data get entity @s Pose.RightArm[0] 1000
|
||||
execute store result score @s as_pose run data get entity @s Pose.LeftArm[0] 1000
|
||||
execute store result entity @s Pose.RightArm[0] float 0.001 run scoreboard players get @s as_pose
|
||||
execute store result entity @s Pose.LeftArm[0] float 0.001 run scoreboard players get #as_temp as_pose
|
||||
#
|
||||
execute store result score #as_temp as_pose run data get entity @s Pose.RightArm[1] -1000
|
||||
execute store result score @s as_pose run data get entity @s Pose.LeftArm[1] -1000
|
||||
execute store result entity @s Pose.RightArm[1] float 0.001 run scoreboard players get @s as_pose
|
||||
execute store result entity @s Pose.LeftArm[1] float 0.001 run scoreboard players get #as_temp as_pose
|
||||
#
|
||||
execute store result score #as_temp as_pose run data get entity @s Pose.RightArm[2] -1000
|
||||
execute store result score @s as_pose run data get entity @s Pose.LeftArm[2] -1000
|
||||
execute store result entity @s Pose.RightArm[2] float 0.001 run scoreboard players get @s as_pose
|
||||
execute store result entity @s Pose.LeftArm[2] float 0.001 run scoreboard players get #as_temp as_pose
|
||||
#
|
||||
# Legs
|
||||
#
|
||||
execute store result score #as_temp as_pose run data get entity @s Pose.RightLeg[0] 1000
|
||||
execute store result score @s as_pose run data get entity @s Pose.LeftLeg[0] 1000
|
||||
execute store result entity @s Pose.RightLeg[0] float 0.001 run scoreboard players get @s as_pose
|
||||
execute store result entity @s Pose.LeftLeg[0] float 0.001 run scoreboard players get #as_temp as_pose
|
||||
#
|
||||
execute store result score #as_temp as_pose run data get entity @s Pose.RightLeg[1] -1000
|
||||
execute store result score @s as_pose run data get entity @s Pose.LeftLeg[1] -1000
|
||||
execute store result entity @s Pose.RightLeg[1] float 0.001 run scoreboard players get @s as_pose
|
||||
execute store result entity @s Pose.LeftLeg[1] float 0.001 run scoreboard players get #as_temp as_pose
|
||||
#
|
||||
execute store result score #as_temp as_pose run data get entity @s Pose.RightLeg[2] -1000
|
||||
execute store result score @s as_pose run data get entity @s Pose.LeftLeg[2] -1000
|
||||
execute store result entity @s Pose.RightLeg[2] float 0.001 run scoreboard players get @s as_pose
|
||||
execute store result entity @s Pose.LeftLeg[2] float 0.001 run scoreboard players get #as_temp as_pose
|
||||
#
|
||||
# Head
|
||||
#
|
||||
execute store result score @s as_pose run data get entity @s Pose.Head[1] -1000
|
||||
execute store result entity @s Pose.Head[1] float 0.001 run scoreboard players get @s as_pose
|
||||
execute store result score @s as_pose run data get entity @s Pose.Head[2] -1000
|
||||
execute store result entity @s Pose.Head[2] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
# Body
|
||||
#
|
||||
execute store result score @s as_pose run data get entity @s Pose.Body[1] -1000
|
||||
execute store result entity @s Pose.Body[1] float 0.001 run scoreboard players get @s as_pose
|
||||
execute store result score @s as_pose run data get entity @s Pose.Body[2] -1000
|
||||
execute store result entity @s Pose.Body[2] float 0.001 run scoreboard players get @s as_pose
|
||||
#
|
||||
# Clear temporary dummy player
|
||||
#
|
||||
scoreboard players reset #as_temp as_pose
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Description: Records UUID of the last editor of the armor stand
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
execute store result score @s as_edited_uuid1 run data get entity @p[tag=as_selected] UUID[0]
|
||||
execute store result score @s as_edited_uuid2 run data get entity @p[tag=as_selected] UUID[1]
|
||||
execute store result score @s as_edited_uuid3 run data get entity @p[tag=as_selected] UUID[2]
|
||||
execute store result score @s as_edited_uuid4 run data get entity @p[tag=as_selected] UUID[3]
|
23
data/armor_statues/functions/trigger/lock.mcfunction
Normal file
23
data/armor_statues/functions/trigger/lock.mcfunction
Normal file
@@ -0,0 +1,23 @@
|
||||
#
|
||||
# Description: Apply or remove as_sealed and/or as_locked tags
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: Player
|
||||
#
|
||||
# Locking prevents the book from being used to modify the stand and disables the equipment slots to prevent accidental interaction
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=1000}] as @e[type=armor_stand,tag=as_selected] run function armor_statues:locking/lock
|
||||
#
|
||||
# Unlocking
|
||||
#
|
||||
# creative player
|
||||
execute if entity @s[scores={as_trigger=1001},gamemode=creative] as @e[type=armor_stand,distance=..3,tag=as_locked,tag=!as_sealed,sort=nearest,limit=1,nbt=!{Marker:1b},nbt=!{Invulnerable:1b}] run function armor_statues:locking/unlock
|
||||
# UUID lock disabled
|
||||
execute if data storage customizable_armor_stands:settings as_admin{uuid_lock:"Disabled"} if entity @s[scores={as_trigger=1001},gamemode=survival] as @e[type=armor_stand,distance=..3,tag=as_locked,tag=!as_sealed,sort=nearest,limit=1,nbt=!{Marker:1b},nbt=!{Invulnerable:1b}] run function armor_statues:locking/unlock
|
||||
# UUID lock enabled
|
||||
execute if data storage customizable_armor_stands:settings as_admin{uuid_lock:"Enabled"} if entity @s[scores={as_trigger=1001},gamemode=survival] as @e[type=armor_stand,distance=..3,tag=as_locked,tag=!as_sealed,sort=nearest,limit=1,nbt=!{Marker:1b},nbt=!{Invulnerable:1b}] run function armor_statues:locking/lock_check
|
||||
#
|
||||
# Sealing can only be used in creative mode and makes the armor stand invulnerable as well as locking it
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=1002},gamemode=creative] if entity @e[type=armor_stand,distance=..3,tag=!as_sealed,sort=nearest,limit=1] run function armor_statues:sealing/seal
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=1003},gamemode=creative] if entity @e[type=armor_stand,distance=..3,tag=as_sealed,sort=nearest,limit=1] run function armor_statues:sealing/seal
|
48
data/armor_statues/functions/trigger/mirror.mcfunction
Normal file
48
data/armor_statues/functions/trigger/mirror.mcfunction
Normal file
@@ -0,0 +1,48 @@
|
||||
#
|
||||
# Description: Mirror armor stand's arms or legs
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Apply bugfix for MC-80975
|
||||
#
|
||||
function armor_statues:bugfix
|
||||
#
|
||||
# Mirror arms left to right
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=131}] store result score @s as_pose run data get entity @s Pose.LeftArm[0] 1000
|
||||
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
|
||||
execute if entity @s[scores={as_trigger=131}] store result score @s as_pose run data get entity @s Pose.LeftArm[1] -1000
|
||||
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
|
||||
execute if entity @s[scores={as_trigger=131}] store result score @s as_pose run data get entity @s Pose.LeftArm[2] -1000
|
||||
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
|
||||
#
|
||||
# Mirror arms right to left
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=132}] store result score @s as_pose run data get entity @s Pose.RightArm[0] 1000
|
||||
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
|
||||
execute if entity @s[scores={as_trigger=132}] store result score @s as_pose run data get entity @s Pose.RightArm[1] -1000
|
||||
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
|
||||
execute if entity @s[scores={as_trigger=132}] store result score @s as_pose run data get entity @s Pose.RightArm[2] -1000
|
||||
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
|
||||
#
|
||||
# Mirror legs left to right
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=133}] store result score @s as_pose run data get entity @s Pose.LeftLeg[0] 1000
|
||||
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
|
||||
execute if entity @s[scores={as_trigger=133}] store result score @s as_pose run data get entity @s Pose.LeftLeg[1] -1000
|
||||
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
|
||||
execute if entity @s[scores={as_trigger=133}] store result score @s as_pose run data get entity @s Pose.LeftLeg[2] -1000
|
||||
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
|
||||
#
|
||||
# Mirror legs right to left
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=134}] store result score @s as_pose run data get entity @s Pose.RightLeg[0] 1000
|
||||
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
|
||||
execute if entity @s[scores={as_trigger=134}] store result score @s as_pose run data get entity @s Pose.RightLeg[1] -1000
|
||||
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
|
||||
execute if entity @s[scores={as_trigger=134}] store result score @s as_pose run data get entity @s Pose.RightLeg[2] -1000
|
||||
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
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
16
data/armor_statues/functions/trigger/paste.mcfunction
Normal file
16
data/armor_statues/functions/trigger/paste.mcfunction
Normal file
@@ -0,0 +1,16 @@
|
||||
#
|
||||
# Description: Paste armor stand settings and pose from book
|
||||
# Called by: as_statue:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
execute as @p[tag=as_selected] run function armor_statues:storage_in
|
||||
#
|
||||
data modify entity @s {} merge from storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose
|
||||
data modify entity @s Pose set from storage customizable_armor_stands:book_storage SavedItem.tag.SavedPose.Pose
|
||||
#
|
||||
title @a[tag=as_selected,tag=!as_chat] actionbar {"text":"Settings and pose pasted from the book","color":"dark_green"}
|
||||
tellraw @a[tag=as_selected,tag=as_chat] {"text":"<Stick_God> Settings and pose pasted from the book","color":"dark_green"}
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
77
data/armor_statues/functions/trigger/pointing.mcfunction
Normal file
77
data/armor_statues/functions/trigger/pointing.mcfunction
Normal file
@@ -0,0 +1,77 @@
|
||||
#
|
||||
# Description: Points an appendage at the player
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Summons temp armor stand
|
||||
#
|
||||
# Head
|
||||
execute if score @s as_trigger matches 1160 rotated ~ 0 run summon minecraft:armor_stand ^ ^-0.1875 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
execute if score @s as_trigger matches 1166 rotated ~ 0 run summon minecraft:armor_stand ^ ^-0.1875 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
# Body
|
||||
execute if score @s as_trigger matches 1161 rotated ~ 0 run summon minecraft:armor_stand ^ ^-0.125 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
execute if score @s as_trigger matches 1167 rotated ~ 0 run summon minecraft:armor_stand ^ ^-0.125 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
# Right Arm
|
||||
execute if score @s as_trigger matches 1162 rotated ~ 0 run summon minecraft:armor_stand ^-0.34375 ^-0.1875 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
execute if score @s as_trigger matches 1168 rotated ~ 0 run summon minecraft:armor_stand ^-0.34375 ^-0.1875 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
# Left Arm
|
||||
execute if score @s as_trigger matches 1163 rotated ~ 0 run summon minecraft:armor_stand ^0.34375 ^-0.1875 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
execute if score @s as_trigger matches 1169 rotated ~ 0 run summon minecraft:armor_stand ^0.34375 ^-0.1875 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
# Right Leg
|
||||
execute if score @s as_trigger matches 1164 rotated ~ 0 run summon minecraft:armor_stand ^-0.125 ^-0.875 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
execute if score @s as_trigger matches 1170 rotated ~ 0 run summon minecraft:armor_stand ^-0.125 ^-0.875 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
# Left Leg
|
||||
execute if score @s as_trigger matches 1165 rotated ~ 0 run summon minecraft:armor_stand ^0.125 ^-0.875 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
execute if score @s as_trigger matches 1171 rotated ~ 0 run summon minecraft:armor_stand ^0.125 ^-0.875 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
#
|
||||
execute if score @s as_trigger matches 1160..1165 as @e[type=minecraft:armor_stand,limit=1,tag=as_temp_armor_stand] at @s positioned ~ ~1.625 ~ run tp @s ~ ~ ~ facing entity @p[tag=as_selected] eyes
|
||||
execute if score @s as_trigger matches 1166..1171 as @e[type=minecraft:armor_stand,limit=1,tag=as_temp_armor_stand] at @s positioned ~ ~1.625 ~ run tp @s ~ ~ ~ facing entity @p[tag=as_selected] feet
|
||||
#
|
||||
execute store result score #temp_as_x as_angle run data get entity @e[type=minecraft:armor_stand,limit=1,tag=as_temp_armor_stand] Rotation[0] 1000
|
||||
execute store result score #temp_as_z as_angle run data get entity @e[type=minecraft:armor_stand,limit=1,tag=as_temp_armor_stand] Rotation[1] 1000
|
||||
execute store result score #selected_as_x as_angle run data get entity @s Rotation[0] 1000
|
||||
execute store result score #selected_as_z as_angle run data get entity @s Rotation[1] 1000
|
||||
scoreboard players operation #temp_as_x as_angle -= #selected_as_x as_angle
|
||||
# Appendage offset
|
||||
scoreboard players operation #temp_as_z as_angle -= #var90000 as_angle
|
||||
# Head rotation offset
|
||||
execute if score @s as_trigger matches 1160 run scoreboard players operation #temp_as_z as_angle += #var180000 as_angle
|
||||
execute if score @s as_trigger matches 1166 run scoreboard players operation #temp_as_z as_angle += #var180000 as_angle
|
||||
#
|
||||
execute if score #temp_as_x as_angle matches 180000.. run scoreboard players operation #temp_as_x as_angle -= #var360000 as_angle
|
||||
execute if score #temp_as_x as_angle matches ..-180000 run scoreboard players operation #temp_as_x as_angle += #var360000 as_angle
|
||||
execute if score #temp_as_x as_angle matches 90000.. run scoreboard players operation #temp_as_z as_angle *= #var-1 as_angle
|
||||
execute if score #temp_as_x as_angle matches ..-90000 run scoreboard players operation #temp_as_z as_angle *= #var-1 as_angle
|
||||
execute if score #temp_as_x as_angle matches 90000.. run scoreboard players operation #temp_as_x as_angle -= #var180000 as_angle
|
||||
execute if score #temp_as_x as_angle matches ..-90000 run scoreboard players operation #temp_as_x as_angle += #var180000 as_angle
|
||||
#scoreboard players operation #temp_as_x as_angle *= #var-1 as_angle
|
||||
#scoreboard players operation #temp_as_z as_angle *= #var-1 as_angle
|
||||
data modify storage customizable_armor_stands:appendage appendage set value [0f,0f,0f]
|
||||
execute store result storage customizable_armor_stands:appendage appendage[1] float 0.001 run scoreboard players get #temp_as_x as_angle
|
||||
execute store result storage customizable_armor_stands:appendage appendage[0] float 0.001 run scoreboard players get #temp_as_z as_angle
|
||||
# Head
|
||||
execute if score @s as_trigger matches 1160 run data modify entity @s Pose.Head set from storage customizable_armor_stands:appendage appendage
|
||||
execute if score @s as_trigger matches 1166 run data modify entity @s Pose.Head set from storage customizable_armor_stands:appendage appendage
|
||||
# Body
|
||||
execute if score @s as_trigger matches 1161 run data modify entity @s Pose.Body set from storage customizable_armor_stands:appendage appendage
|
||||
execute if score @s as_trigger matches 1167 run data modify entity @s Pose.Body set from storage customizable_armor_stands:appendage appendage
|
||||
# Right Arm
|
||||
execute if score @s as_trigger matches 1162 run data modify entity @s Pose.RightArm set from storage customizable_armor_stands:appendage appendage
|
||||
execute if score @s as_trigger matches 1168 run data modify entity @s Pose.RightArm set from storage customizable_armor_stands:appendage appendage
|
||||
# Left Arm
|
||||
execute if score @s as_trigger matches 1163 run data modify entity @s Pose.LeftArm set from storage customizable_armor_stands:appendage appendage
|
||||
execute if score @s as_trigger matches 1169 run data modify entity @s Pose.LeftArm set from storage customizable_armor_stands:appendage appendage
|
||||
# Right Leg
|
||||
execute if score @s as_trigger matches 1164 run data modify entity @s Pose.RightLeg set from storage customizable_armor_stands:appendage appendage
|
||||
execute if score @s as_trigger matches 1170 run data modify entity @s Pose.RightLeg set from storage customizable_armor_stands:appendage appendage
|
||||
# Left Leg
|
||||
execute if score @s as_trigger matches 1165 run data modify entity @s Pose.LeftLeg set from storage customizable_armor_stands:appendage appendage
|
||||
execute if score @s as_trigger matches 1171 run data modify entity @s Pose.LeftLeg set from storage customizable_armor_stands:appendage appendage
|
||||
#
|
||||
# Kills temp armor stand
|
||||
#
|
||||
kill @e[type=armor_stand,tag=as_temp_armor_stand]
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
@@ -0,0 +1,77 @@
|
||||
#
|
||||
# Description: Points an appendage at the player for small armor stands
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Summons temp armor stand
|
||||
#
|
||||
# Head
|
||||
execute if score @s as_trigger matches 1160 rotated ~ 0 run summon minecraft:armor_stand ^ ^-0.28125 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
execute if score @s as_trigger matches 1166 rotated ~ 0 run summon minecraft:armor_stand ^ ^-0.28125 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
# Body
|
||||
execute if score @s as_trigger matches 1161 rotated ~ 0 run summon minecraft:armor_stand ^ ^-0.25 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
execute if score @s as_trigger matches 1167 rotated ~ 0 run summon minecraft:armor_stand ^ ^-0.25 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
# Right Arm
|
||||
execute if score @s as_trigger matches 1162 rotated ~ 0 run summon minecraft:armor_stand ^-0.171875 ^-0.28125 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
execute if score @s as_trigger matches 1168 rotated ~ 0 run summon minecraft:armor_stand ^-0.171875 ^-0.28125 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
# Left Arm
|
||||
execute if score @s as_trigger matches 1163 rotated ~ 0 run summon minecraft:armor_stand ^0.171875 ^-0.28125 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
execute if score @s as_trigger matches 1169 rotated ~ 0 run summon minecraft:armor_stand ^0.171875 ^-0.28125 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
# Right Leg
|
||||
execute if score @s as_trigger matches 1164 rotated ~ 0 run summon minecraft:armor_stand ^-0.0625 ^-0.625 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
execute if score @s as_trigger matches 1170 rotated ~ 0 run summon minecraft:armor_stand ^-0.0625 ^-0.625 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
# Left Leg
|
||||
execute if score @s as_trigger matches 1165 rotated ~ 0 run summon minecraft:armor_stand ^0.0625 ^-0.625 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
execute if score @s as_trigger matches 1171 rotated ~ 0 run summon minecraft:armor_stand ^0.0625 ^-0.625 ^ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
#
|
||||
execute if score @s as_trigger matches 1160..1165 as @e[type=minecraft:armor_stand,limit=1,tag=as_temp_armor_stand] at @s positioned ~ ~1 ~ run tp @s ~ ~ ~ facing entity @p[tag=as_selected] eyes
|
||||
execute if score @s as_trigger matches 1166..1171 as @e[type=minecraft:armor_stand,limit=1,tag=as_temp_armor_stand] at @s positioned ~ ~1 ~ run tp @s ~ ~ ~ facing entity @p[tag=as_selected] feet
|
||||
#
|
||||
execute store result score #temp_as_x as_angle run data get entity @e[type=minecraft:armor_stand,limit=1,tag=as_temp_armor_stand] Rotation[0] 1000
|
||||
execute store result score #temp_as_z as_angle run data get entity @e[type=minecraft:armor_stand,limit=1,tag=as_temp_armor_stand] Rotation[1] 1000
|
||||
execute store result score #selected_as_x as_angle run data get entity @s Rotation[0] 1000
|
||||
execute store result score #selected_as_z as_angle run data get entity @s Rotation[1] 1000
|
||||
scoreboard players operation #temp_as_x as_angle -= #selected_as_x as_angle
|
||||
# Appendage offset
|
||||
scoreboard players operation #temp_as_z as_angle -= #var90000 as_angle
|
||||
# Head rotation offset
|
||||
execute if score @s as_trigger matches 1160 run scoreboard players operation #temp_as_z as_angle += #var180000 as_angle
|
||||
execute if score @s as_trigger matches 1166 run scoreboard players operation #temp_as_z as_angle += #var180000 as_angle
|
||||
#
|
||||
execute if score #temp_as_x as_angle matches 180000.. run scoreboard players operation #temp_as_x as_angle -= #var360000 as_angle
|
||||
execute if score #temp_as_x as_angle matches ..-180000 run scoreboard players operation #temp_as_x as_angle += #var360000 as_angle
|
||||
execute if score #temp_as_x as_angle matches 90000.. run scoreboard players operation #temp_as_z as_angle *= #var-1 as_angle
|
||||
execute if score #temp_as_x as_angle matches ..-90000 run scoreboard players operation #temp_as_z as_angle *= #var-1 as_angle
|
||||
execute if score #temp_as_x as_angle matches 90000.. run scoreboard players operation #temp_as_x as_angle -= #var180000 as_angle
|
||||
execute if score #temp_as_x as_angle matches ..-90000 run scoreboard players operation #temp_as_x as_angle += #var180000 as_angle
|
||||
#scoreboard players operation #temp_as_x as_angle *= #var-1 as_angle
|
||||
#scoreboard players operation #temp_as_z as_angle *= #var-1 as_angle
|
||||
data modify storage customizable_armor_stands:appendage appendage set value [0f,0f,0f]
|
||||
execute store result storage customizable_armor_stands:appendage appendage[1] float 0.001 run scoreboard players get #temp_as_x as_angle
|
||||
execute store result storage customizable_armor_stands:appendage appendage[0] float 0.001 run scoreboard players get #temp_as_z as_angle
|
||||
# Head
|
||||
execute if score @s as_trigger matches 1160 run data modify entity @s Pose.Head set from storage customizable_armor_stands:appendage appendage
|
||||
execute if score @s as_trigger matches 1166 run data modify entity @s Pose.Head set from storage customizable_armor_stands:appendage appendage
|
||||
# Body
|
||||
execute if score @s as_trigger matches 1161 run data modify entity @s Pose.Body set from storage customizable_armor_stands:appendage appendage
|
||||
execute if score @s as_trigger matches 1167 run data modify entity @s Pose.Body set from storage customizable_armor_stands:appendage appendage
|
||||
# Right Arm
|
||||
execute if score @s as_trigger matches 1162 run data modify entity @s Pose.RightArm set from storage customizable_armor_stands:appendage appendage
|
||||
execute if score @s as_trigger matches 1168 run data modify entity @s Pose.RightArm set from storage customizable_armor_stands:appendage appendage
|
||||
# Left Arm
|
||||
execute if score @s as_trigger matches 1163 run data modify entity @s Pose.LeftArm set from storage customizable_armor_stands:appendage appendage
|
||||
execute if score @s as_trigger matches 1169 run data modify entity @s Pose.LeftArm set from storage customizable_armor_stands:appendage appendage
|
||||
# Right Leg
|
||||
execute if score @s as_trigger matches 1164 run data modify entity @s Pose.RightLeg set from storage customizable_armor_stands:appendage appendage
|
||||
execute if score @s as_trigger matches 1170 run data modify entity @s Pose.RightLeg set from storage customizable_armor_stands:appendage appendage
|
||||
# Left Leg
|
||||
execute if score @s as_trigger matches 1165 run data modify entity @s Pose.LeftLeg set from storage customizable_armor_stands:appendage appendage
|
||||
execute if score @s as_trigger matches 1171 run data modify entity @s Pose.LeftLeg set from storage customizable_armor_stands:appendage appendage
|
||||
#
|
||||
# Kills temp armor stand
|
||||
#
|
||||
kill @e[type=armor_stand,tag=as_temp_armor_stand]
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
35
data/armor_statues/functions/trigger/position.mcfunction
Normal file
35
data/armor_statues/functions/trigger/position.mcfunction
Normal file
@@ -0,0 +1,35 @@
|
||||
#
|
||||
# Description: Nudge postion of armor stand
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Trigger values 41, 42, 45, 46, 49 and 50 are redundant and kept for backwards compatibility
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=40}] at @s run tp @s ~-0.5 ~ ~
|
||||
execute if entity @s[scores={as_trigger=101}] at @s run tp @s ~-0.1875 ~ ~
|
||||
execute if entity @s[scores={as_trigger=41}] at @s run tp @s ~-0.1 ~ ~
|
||||
execute if entity @s[scores={as_trigger=102}] at @s run tp @s ~-0.0625 ~ ~
|
||||
execute if entity @s[scores={as_trigger=103}] at @s run tp @s ~0.0625 ~ ~
|
||||
execute if entity @s[scores={as_trigger=42}] at @s run tp @s ~0.1 ~ ~
|
||||
execute if entity @s[scores={as_trigger=104}] at @s run tp @s ~0.1875 ~ ~
|
||||
execute if entity @s[scores={as_trigger=43}] at @s run tp @s ~0.5 ~ ~
|
||||
execute if entity @s[scores={as_trigger=44}] at @s run tp @s ~ ~-0.5 ~
|
||||
execute if entity @s[scores={as_trigger=105}] at @s run tp @s ~ ~-0.1875 ~
|
||||
execute if entity @s[scores={as_trigger=45}] at @s run tp @s ~ ~-0.1 ~
|
||||
execute if entity @s[scores={as_trigger=106}] at @s run tp @s ~ ~-0.0625 ~
|
||||
execute if entity @s[scores={as_trigger=107}] at @s run tp @s ~ ~0.0625 ~
|
||||
execute if entity @s[scores={as_trigger=46}] at @s run tp @s ~ ~0.1 ~
|
||||
execute if entity @s[scores={as_trigger=108}] at @s run tp @s ~ ~0.1875 ~
|
||||
execute if entity @s[scores={as_trigger=47}] at @s run tp @s ~ ~0.5 ~
|
||||
execute if entity @s[scores={as_trigger=48}] at @s run tp @s ~ ~ ~-0.5
|
||||
execute if entity @s[scores={as_trigger=109}] at @s run tp @s ~ ~ ~-0.1875
|
||||
execute if entity @s[scores={as_trigger=49}] at @s run tp @s ~ ~ ~-0.1
|
||||
execute if entity @s[scores={as_trigger=110}] at @s run tp @s ~ ~ ~-0.0625
|
||||
execute if entity @s[scores={as_trigger=111}] at @s run tp @s ~ ~ ~0.0625
|
||||
execute if entity @s[scores={as_trigger=50}] at @s run tp @s ~ ~ ~0.1
|
||||
execute if entity @s[scores={as_trigger=112}] at @s run tp @s ~ ~ ~0.1875
|
||||
execute if entity @s[scores={as_trigger=51}] at @s run tp @s ~ ~ ~0.5
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
@@ -0,0 +1,37 @@
|
||||
#
|
||||
# Description: Nudge postion of armor stand relative to the player
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Summons temp armor stand
|
||||
summon minecraft:armor_stand ~ ~ ~ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
tp @e[type=armor_stand,tag=as_temp_armor_stand] ~ ~ ~ facing entity @p[tag=as_selected]
|
||||
#
|
||||
# stores temp armor stand angle
|
||||
#
|
||||
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]
|
||||
# Facing south
|
||||
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
|
||||
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
|
||||
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
|
||||
# Facing West
|
||||
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
|
||||
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
|
||||
# Facing North
|
||||
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
|
||||
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
|
||||
# Facing East
|
||||
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
|
||||
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
|
||||
#
|
||||
# Relative nudge from player function
|
||||
#
|
||||
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
|
||||
#
|
||||
# Kills temp armor stand
|
||||
#
|
||||
kill @e[type=armor_stand,tag=as_temp_armor_stand]
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
32
data/armor_statues/functions/trigger/presets.mcfunction
Normal file
32
data/armor_statues/functions/trigger/presets.mcfunction
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# Description: Put armor stand into a preset pose
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=20}] run data merge entity @s {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]}}
|
||||
execute if entity @s[scores={as_trigger=21}] run data merge entity @s {Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[20.0f,0.0f,10.0f],LeftArm:[-20.0f,0.0f,-10.0f],RightLeg:[-20.0f,0.0f,0.0f],LeftLeg:[20.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=22}] run data merge entity @s {Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-40.0f,0.0f,10.0f],LeftArm:[40.0f,0.0f,-10.0f],RightLeg:[40.0f,0.0f,0.0f],LeftLeg:[-40.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=23}] run data merge entity @s {Pose:{Head:[0.0f,20.0f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-90.0f,18.0f,0.0f],LeftArm:[0.0f,0.0f,-10.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=24}] run data merge entity @s {Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-20.0f,-20.0f,0.0f],LeftArm:[-50.0f,50.0f,0.0f],RightLeg:[-20.0f,0.0f,0.0f],LeftLeg:[20.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=25}] run data merge entity @s {Pose:{Head:[0.0f,0.001f,0.0f],Body:[15.0f,0.0f,0.0f],RightArm:[-60.0f,-10.0f,0.0f],LeftArm:[10.0f,0.0f,-10.0f],RightLeg:[-15.0f,0.0f,0.0f],LeftLeg:[30.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=26}] run data merge entity @s {Pose:{Head:[-15.0f,0.0f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-120.0f,-10.0f,0.0f],LeftArm:[10.0f,0.0f,-10.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[15.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=27}] run data merge entity @s {Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-80.0f,20.0f,0.0f],LeftArm:[-80.0f,-20.0f,0.0f],RightLeg:[-90.0f,10.0f,0.0f],LeftLeg:[-90.0f,-10.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=28}] run data merge entity @s {Pose:{Head:[-15.0f,0.0f,0.0f],Body:[10.0f,0.0f,0.0f],RightArm:[-140.0f,-10.0f,0.0f],LeftArm:[70.0f,0.0f,-10.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[75.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=29}] run data merge entity @s {Pose:{Head:[0.0f,0.001f,0.0f],Body:[10.0f,0.0f,0.0f],RightArm:[-90.0f,-10.0f,0.0f],LeftArm:[-75.0f,0.0f,10.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[75.0f,0.0f,0.0f]}}
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=30}] run data merge entity @s {Pose:{Head:[-10.0f,20.0f,0.0f],Body:[-2.0f,0.0f,0.0f],RightArm:[5.0f,0.0f,0.0f],LeftArm:[5.0f,0.0f,0.0f],RightLeg:[16.0f,2.0f,10.0f],LeftLeg:[0.0f,-10.0f,-4.0f]}}
|
||||
execute if entity @s[scores={as_trigger=31}] run data merge entity @s {Pose:{Head:[0.0f,0.001f,0.0f],Body:[5.0f,0.0f,0.0f],RightArm:[-124.0f,-51.0f,-35.0f],LeftArm:[29.0f,0.0f,25.0f],RightLeg:[0.0f,-4.0f,-2.0f],LeftLeg:[0.0f,4.0f,2.0f]}}
|
||||
execute if entity @s[scores={as_trigger=32}] run data merge entity @s {Pose:{Head:[-85.0f,0.0f,0.0f],Body:[-90.0f,0.0f,0.0f],RightArm:[-90.0f,10.0f,0.0f],LeftArm:[-90.0f,-10.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=33}] run data merge entity @s {Pose:{Head:[45.0f,-4.0f,1.0f],Body:[10.0f,0.0f,0.0f],RightArm:[18.0f,-14.0f,0.0f],LeftArm:[-72.0f,24.0f,47.0f],RightLeg:[25.0f,-2.0f,0.0f],LeftLeg:[-4.0f,-6.0f,-2.0f]}}
|
||||
execute if entity @s[scores={as_trigger=34}] run data merge entity @s {Pose:{Head:[14.0f,-12.0f,6.0f],Body:[5.0f,0.0f,0.0f],RightArm:[-40.0f,20.0f,0.0f],LeftArm:[-4.0f,-20.0f,-10.0f],RightLeg:[-88.0f,71.0f,0.0f],LeftLeg:[-88.0f,46.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=35}] run data merge entity @s {Pose:{Head:[0.0f,30.0f,0f],Body:[0.0f,13.0f,0.0f],RightArm:[-22.0f,31.0f,10.0f],LeftArm:[145.0f,22.0f,-49.0f],RightLeg:[6.0f,-20.0f,0.0f],LeftLeg:[-6.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=36}] run data merge entity @s {Pose:{Head:[4.0f,0.0f,0.0f],Body:[4.0f,0.0f,0.0f],RightArm:[30.0f,22.0f,-20.0f],LeftArm:[30.0f,-20.0f,21.0f],RightLeg:[0.0f,0.0f,5.0f],LeftLeg:[0.0f,0.0f,-5.0f]}}
|
||||
execute if entity @s[scores={as_trigger=37}] run data merge entity @s {Pose:{Head:[63.0f,0.0f,0.0f],Body:[10.0f,0.0f,0.0f],RightArm:[-5.0f,0.0f,5.0f],LeftArm:[-5.0f,0.0f,-5.0f],RightLeg:[-5.0f,-10.0f,5.0f],LeftLeg:[-5.0f,16.0f,-5.0f]}}
|
||||
execute if entity @s[scores={as_trigger=38}] run data merge entity @s {Pose:{Head:[-11.0f,0.0f,0.0f],Body:[-4.0f,0.0f,0.0f],RightArm:[0.0f,0.0f,100.0f],LeftArm:[0.0f,0.0f,-100.0f],RightLeg:[-8.0f,0.0f,60.0f],LeftLeg:[-8.0f,0.0f,-60.0f]}}
|
||||
execute if entity @s[scores={as_trigger=39}] run data merge entity @s {Pose:{Head:[-22.0f,25.0f,0.0f],Body:[-4.0f,10.0f,0.0f],RightArm:[-153.0f,34.0f,-3.0f],LeftArm:[4.0f,18.0f,0.0f],RightLeg:[-4.0f,17.0f,2.0f],LeftLeg:[6.0f,24.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=141}] run data merge entity @s {Pose:{Head:[0.0f,0.001f,0.0f],Body:[0.0f,0.001f,0.0f],RightArm:[-15.0f,-45.0f,0.0f],LeftArm:[0.0f,0.0f,0.0f],RightLeg:[0.0f,0.0f,0.0f],LeftLeg:[0.0f,0.0f,0.0f]}}
|
||||
execute if entity @s[scores={as_trigger=142}] run data merge entity @s {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]}}
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
54
data/armor_statues/functions/trigger/rack.mcfunction
Normal file
54
data/armor_statues/functions/trigger/rack.mcfunction
Normal file
@@ -0,0 +1,54 @@
|
||||
#
|
||||
# Description: Align stand with tripwire hook to make a tool rack
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Turn off gravity for armor stand
|
||||
#
|
||||
data merge entity @s {NoGravity:1b}
|
||||
#
|
||||
# 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
|
||||
#
|
||||
execute at @s align xyz positioned ~0.5 ~ ~0.5 if block ~ ~1 ~ minecraft:tripwire_hook run tp @s ~ ~ ~
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack
|
||||
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 ~ ~ ~
|
||||
execute if entity @s[tag=!as_rack] at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack
|
||||
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 ~ ~ ~
|
||||
execute if entity @s[tag=!as_rack] at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack
|
||||
#
|
||||
# If there is a tripwire hook above the armor stand, rotate the stand to match it's orientation
|
||||
#
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=north] run data merge entity @s {Rotation:[180.0f,0.0f]}
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=east] run data merge entity @s {Rotation:[-90.0f,0.0f]}
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=south] run data merge entity @s {Rotation:[0.0f,0.0f]}
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=west] run data merge entity @s {Rotation:[90.0f,0.0f]}
|
||||
#
|
||||
# If armor stand is not tagged, display failure message
|
||||
#
|
||||
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"}]
|
||||
execute if entity @s[tag=!as_rack] run tellraw @a[tag=as_selected,tag=as_chat] [{"text":"<Stick_God> ","color":"dark_green"},{"text":"Tripwire hook not found","color":"dark_red"}]
|
||||
#
|
||||
# Otherwise, adjust the armor stand pose and settings, disabling all slots but the main hand, and move it into place
|
||||
#
|
||||
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}
|
||||
execute if entity @s[tag=as_rack,scores={as_trigger=155}] at @s run tp @s ^-0.17 ^0.24 ^-0.05
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_modified
|
||||
#
|
||||
# Also, mark as locked
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_locked
|
||||
#
|
||||
# add Player UUID lock
|
||||
#
|
||||
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]
|
||||
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]
|
||||
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]
|
||||
execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid4 run data get entity @p[tag=as_selected] UUID[3]
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_uuid_locked
|
||||
#
|
||||
# Finally, remove the as_rack tag
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run tag @s remove as_rack
|
54
data/armor_statues/functions/trigger/rack_small.mcfunction
Normal file
54
data/armor_statues/functions/trigger/rack_small.mcfunction
Normal file
@@ -0,0 +1,54 @@
|
||||
#
|
||||
# Description: Align stand with tripwire hook to make a tool rack for small armor stands
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Turn off gravity for armor stand
|
||||
#
|
||||
data merge entity @s {NoGravity:1b}
|
||||
#
|
||||
# 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
|
||||
#
|
||||
execute at @s align xyz positioned ~0.5 ~ ~0.5 if block ~ ~1 ~ minecraft:tripwire_hook run tp @s ~ ~ ~
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack
|
||||
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 ~ ~ ~
|
||||
execute if entity @s[tag=!as_rack] at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack
|
||||
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 ~ ~ ~
|
||||
execute if entity @s[tag=!as_rack] at @s if block ~ ~1 ~ minecraft:tripwire_hook run tag @s add as_rack
|
||||
#
|
||||
# If there is a tripwire hook above the armor stand, rotate the stand to match it's orientation
|
||||
#
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=north] run data merge entity @s {Rotation:[180.0f,0.0f]}
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=east] run data merge entity @s {Rotation:[-90.0f,0.0f]}
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=south] run data merge entity @s {Rotation:[0.0f,0.0f]}
|
||||
execute at @s if block ~ ~1 ~ minecraft:tripwire_hook[facing=west] run data merge entity @s {Rotation:[90.0f,0.0f]}
|
||||
#
|
||||
# If armor stand is not tagged, display failure message
|
||||
#
|
||||
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"}]
|
||||
execute if entity @s[tag=!as_rack] run tellraw @a[tag=as_selected,tag=as_chat] [{"text":"<Stick_God> ","color":"dark_green"},{"text":"Tripwire hook not found","color":"dark_red"}]
|
||||
#
|
||||
# Otherwise, adjust the armor stand pose and settings, disabling all slots but the main hand, and move it into place
|
||||
#
|
||||
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}
|
||||
execute if entity @s[tag=as_rack,scores={as_trigger=155}] at @s run tp @s ^-0.085 ^0.87 ^-0.05
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_modified
|
||||
#
|
||||
# Also, mark as locked
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_locked
|
||||
#
|
||||
# add Player UUID lock
|
||||
#
|
||||
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]
|
||||
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]
|
||||
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]
|
||||
execute if entity @s[tag=as_rack] run execute store result score @s as_lock_uuid4 run data get entity @p[tag=as_selected] UUID[3]
|
||||
execute if entity @s[tag=as_rack] run tag @s add as_uuid_locked
|
||||
#
|
||||
# Finally, remove the as_rack tag
|
||||
#
|
||||
execute if entity @s[tag=as_rack] run tag @s remove as_rack
|
32
data/armor_statues/functions/trigger/random_pose.mcfunction
Normal file
32
data/armor_statues/functions/trigger/random_pose.mcfunction
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# Description: Randomizes armor stand pose
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Summons temp armor stand
|
||||
summon minecraft:armor_stand ~ 0 ~ {NoGravity:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["as_temp_armor_stand"],DisabledSlots:4144959,Silent:1b}
|
||||
#
|
||||
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]}
|
||||
#
|
||||
loot replace entity @e[type=minecraft:armor_stand,tag=as_temp_armor_stand] armor.head loot armor_statues:random_pose
|
||||
#
|
||||
# Generate randomizers
|
||||
#
|
||||
execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_temp_armor_stand] run function armor_statues:randomizer/head
|
||||
execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_temp_armor_stand] run function armor_statues:randomizer/body
|
||||
execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_temp_armor_stand] run function armor_statues:randomizer/left_arm
|
||||
execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_temp_armor_stand] run function armor_statues:randomizer/right_arm
|
||||
execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_temp_armor_stand] run function armor_statues:randomizer/left_leg
|
||||
execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1,tag=as_temp_armor_stand] run function armor_statues:randomizer/right_leg
|
||||
#
|
||||
# Sets random pose
|
||||
#
|
||||
data modify entity @s Pose set from storage customizable_armor_stands:pose_storage Pose
|
||||
#
|
||||
# Kills temp armor stand
|
||||
#
|
||||
kill @e[type=armor_stand,tag=as_temp_armor_stand]
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
21
data/armor_statues/functions/trigger/rotation.mcfunction
Normal file
21
data/armor_statues/functions/trigger/rotation.mcfunction
Normal file
@@ -0,0 +1,21 @@
|
||||
#
|
||||
# Description: Adjust rotation of armor stand
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Note: The function is being executed at the location of the original player, not the armor stand, so @p must be the same player
|
||||
#
|
||||
# Trigger values 52 thru 55 are redundant and kept for backwards compatibility
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=52..57}] store result score @s as_pose run data get entity @s Rotation[0] 1
|
||||
execute if entity @s[scores={as_trigger=52}] run scoreboard players add @s as_pose 45
|
||||
execute if entity @s[scores={as_trigger=53}] run scoreboard players add @s as_pose 5
|
||||
execute if entity @s[scores={as_trigger=54}] run scoreboard players remove @s as_pose 5
|
||||
execute if entity @s[scores={as_trigger=55}] run scoreboard players remove @s as_pose 45
|
||||
execute if entity @s[scores={as_trigger=56}] run scoreboard players operation @s as_pose += @p as_angle
|
||||
execute if entity @s[scores={as_trigger=57}] run scoreboard players operation @s as_pose -= @p as_angle
|
||||
execute if entity @s[scores={as_trigger=52..57}] store result entity @s Rotation[0] float 1 run scoreboard players get @s as_pose
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
28
data/armor_statues/functions/trigger/settings.mcfunction
Normal file
28
data/armor_statues/functions/trigger/settings.mcfunction
Normal file
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# Description: Change the armor stand's basic settings
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=1}] run data merge entity @s {NoBasePlate:0b}
|
||||
execute if entity @s[scores={as_trigger=2}] run data merge entity @s {NoBasePlate:1b}
|
||||
execute if entity @s[scores={as_trigger=3}] run data merge entity @s {ShowArms:1b}
|
||||
execute if entity @s[scores={as_trigger=4}] run data merge entity @s {ShowArms:0b}
|
||||
execute if entity @s[scores={as_trigger=5}] run data merge entity @s {Small:1b}
|
||||
execute if entity @s[scores={as_trigger=6}] run data merge entity @s {Small:0b}
|
||||
execute if entity @s[scores={as_trigger=7}] run data merge entity @s {NoGravity:0b}
|
||||
execute if entity @s[scores={as_trigger=8}] run data merge entity @s {NoGravity:1b}
|
||||
execute if entity @s[scores={as_trigger=9}] run data merge entity @s {Invisible:0b}
|
||||
execute if entity @s[scores={as_trigger=10}] run data merge entity @s {Invisible:1b}
|
||||
execute if entity @s[scores={as_trigger=11}] run data merge entity @s {CustomNameVisible:1b}
|
||||
execute if entity @s[scores={as_trigger=12}] run data merge entity @s {CustomNameVisible:0b}
|
||||
#
|
||||
# Tag the armor stand as modified
|
||||
#
|
||||
tag @s add as_modified
|
||||
#
|
||||
# Report changes to gravity setting as it is not visible
|
||||
#
|
||||
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"}
|
||||
execute if entity @s[scores={as_trigger=7}] run tellraw @a[tag=as_selected,tag=as_chat] {"color":"dark_green","text":"<Stick_God> Gravity is turned on"}
|
||||
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"}
|
||||
execute if entity @s[scores={as_trigger=8}] run tellraw @a[tag=as_selected,tag=as_chat] {"color":"dark_green","text":"<Stick_God> Gravity is turned off"}
|
22
data/armor_statues/functions/trigger/slots.mcfunction
Normal file
22
data/armor_statues/functions/trigger/slots.mcfunction
Normal file
@@ -0,0 +1,22 @@
|
||||
#
|
||||
# Description: Exchange items between equipment slots
|
||||
# Called by: armor_statues:trigger
|
||||
# Entity @s: armor stand
|
||||
#
|
||||
# Creates temporary storage
|
||||
#
|
||||
#data modify storage customizable_armor_stands:slot_storage {} set value {Slots:[{}, {}]}
|
||||
#
|
||||
# Copy item from main hand to temporary storage
|
||||
#
|
||||
data modify storage customizable_armor_stands:slot_storage Slot set from entity @s HandItems[0]
|
||||
#
|
||||
# Copy item from off hand or head to main hand
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=161}] run data modify entity @s HandItems[0] set from entity @s HandItems[1]
|
||||
execute if entity @s[scores={as_trigger=162}] run data modify entity @s HandItems[0] set from entity @s ArmorItems[3]
|
||||
#
|
||||
# Copy item from temporary storage to off hand or head
|
||||
#
|
||||
execute if entity @s[scores={as_trigger=161}] run data modify entity @s HandItems[1] set from storage customizable_armor_stands:slot_storage Slot
|
||||
execute if entity @s[scores={as_trigger=162}] run data modify entity @s ArmorItems[3] set from storage customizable_armor_stands:slot_storage Slot
|
Reference in New Issue
Block a user