From 8fd8ab69be3f9e3aff67e49d4c41f01c92a43ec5 Mon Sep 17 00:00:00 2001 From: MukiTanuki Date: Sun, 24 Sep 2023 16:35:06 -0700 Subject: [PATCH] Optimized random pose --- .../functions/randomizer/body.mcfunction | 31 +++++++-- .../randomizer/body_angle.mcfunction | 2 +- .../functions/randomizer/head.mcfunction | 31 +++++++-- .../randomizer/head_angle.mcfunction | 2 +- .../functions/randomizer/left_arm.mcfunction | 11 +++- .../functions/randomizer/left_leg.mcfunction | 64 +++++++++++++++++-- .../randomizer/left_leg_angle.mcfunction | 2 +- .../functions/randomizer/right_arm.mcfunction | 11 +++- .../functions/randomizer/right_leg.mcfunction | 64 +++++++++++++++++-- .../randomizer/right_leg_angle.mcfunction | 2 +- .../functions/trigger/random_pose.mcfunction | 25 +++++--- pack.mcmeta | 6 +- 12 files changed, 203 insertions(+), 48 deletions(-) diff --git a/data/armor_statues/functions/randomizer/body.mcfunction b/data/armor_statues/functions/randomizer/body.mcfunction index de7b602..e1a704b 100644 --- a/data/armor_statues/functions/randomizer/body.mcfunction +++ b/data/armor_statues/functions/randomizer/body.mcfunction @@ -3,10 +3,27 @@ # Called by: armor_statues:trigger/random_pose # Entity @s: temp armor stand # -execute store result score #x_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"body_x" }].Amount 1000 -execute store result score #y_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"body_y" }].Amount 1000 -execute store result score #z_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"body_z" }].Amount 1000 -function armor_statues:randomizer/body_angle -execute store result storage customizable_armor_stands:pose_storage Pose.Body[0] float 0.001 run scoreboard players get #x_angle as_angle -execute store result storage customizable_armor_stands:pose_storage Pose.Body[1] float 0.001 run scoreboard players get #y_angle as_angle -execute store result storage customizable_armor_stands:pose_storage Pose.Body[2] float 0.001 run scoreboard players get #z_angle as_angle \ No newline at end of file +#execute store result score #x_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"body_x" }].Amount 1000 +#execute store result score #y_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"body_y" }].Amount 1000 +#execute store result score #z_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"body_z" }].Amount 1000 +#function armor_statues:randomizer/body_angle +#execute store result storage customizable_armor_stands:pose_storage Pose.Body[0] float 0.001 run scoreboard players get #x_angle as_angle +#execute store result storage customizable_armor_stands:pose_storage Pose.Body[1] float 0.001 run scoreboard players get #y_angle as_angle +#execute store result storage customizable_armor_stands:pose_storage Pose.Body[2] float 0.001 run scoreboard players get #z_angle as_angle + +# Sets random angle type +scoreboard players set #random_type as_angle 0 +execute if predicate armor_statues:random_chance_10 run scoreboard players set #random_type as_angle 1 +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 +# small angle #random_type=0 +execute if score #random_type as_angle matches 0 store result storage customizable_armor_stands:pose_storage Pose.Body[0] float 0.001 run random value -15000..15000 +execute if score #random_type as_angle matches 0 store result storage customizable_armor_stands:pose_storage Pose.Body[1] float 0.001 run random value -15000..15000 +execute if score #random_type as_angle matches 0 store result storage customizable_armor_stands:pose_storage Pose.Body[2] float 0.001 run random value -15000..15000 +# med angle #random_type=1 +execute if score #random_type as_angle matches 1 store result storage customizable_armor_stands:pose_storage Pose.Body[0] float 0.001 run random value -30000..30000 +execute if score #random_type as_angle matches 1 store result storage customizable_armor_stands:pose_storage Pose.Body[1] float 0.001 run random value -30000..30000 +execute if score #random_type as_angle matches 1 store result storage customizable_armor_stands:pose_storage Pose.Body[2] float 0.001 run random value -30000..30000 +# extreme angle #random_type=2 +execute if score #random_type as_angle matches 2 store result storage customizable_armor_stands:pose_storage Pose.Body[0] float 0.001 run random value -180000..180000 +execute if score #random_type as_angle matches 2 store result storage customizable_armor_stands:pose_storage Pose.Body[1] float 0.001 run random value -180000..180000 +execute if score #random_type as_angle matches 2 store result storage customizable_armor_stands:pose_storage Pose.Body[2] float 0.001 run random value -180000..180000 \ No newline at end of file diff --git a/data/armor_statues/functions/randomizer/body_angle.mcfunction b/data/armor_statues/functions/randomizer/body_angle.mcfunction index 1374363..97f3b44 100644 --- a/data/armor_statues/functions/randomizer/body_angle.mcfunction +++ b/data/armor_statues/functions/randomizer/body_angle.mcfunction @@ -1,6 +1,6 @@ # # Description: adjusts probability -# Called by: armor_statues:randomizer/body +# Called by: UNUSED # Entity @s: temp armor stand # scoreboard players set #x_negative as_angle 0 diff --git a/data/armor_statues/functions/randomizer/head.mcfunction b/data/armor_statues/functions/randomizer/head.mcfunction index e70df8e..615fc0d 100644 --- a/data/armor_statues/functions/randomizer/head.mcfunction +++ b/data/armor_statues/functions/randomizer/head.mcfunction @@ -3,10 +3,27 @@ # Called by: armor_statues:trigger/random_pose # Entity @s: temp armor stand # -execute store result score #x_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"head_x" }].Amount 1000 -execute store result score #y_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"head_y" }].Amount 1000 -execute store result score #z_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"head_z" }].Amount 1000 -function armor_statues:randomizer/head_angle -execute store result storage customizable_armor_stands:pose_storage Pose.Head[0] float 0.001 run scoreboard players get #x_angle as_angle -execute store result storage customizable_armor_stands:pose_storage Pose.Head[1] float 0.001 run scoreboard players get #y_angle as_angle -execute store result storage customizable_armor_stands:pose_storage Pose.Head[2] float 0.001 run scoreboard players get #z_angle as_angle \ No newline at end of file +#execute store result score #x_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"head_x" }].Amount 1000 +#execute store result score #y_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"head_y" }].Amount 1000 +#execute store result score #z_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"head_z" }].Amount 1000 +#function armor_statues:randomizer/head_angle +#execute store result storage customizable_armor_stands:pose_storage Pose.Head[0] float 0.001 run scoreboard players get #x_angle as_angle +#execute store result storage customizable_armor_stands:pose_storage Pose.Head[1] float 0.001 run scoreboard players get #y_angle as_angle +#execute store result storage customizable_armor_stands:pose_storage Pose.Head[2] float 0.001 run scoreboard players get #z_angle as_angle + +# Sets random angle type +scoreboard players set #random_type as_angle 0 +execute if predicate armor_statues:random_chance_20 run scoreboard players set #random_type as_angle 1 +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 +# small angle #random_type=0 +execute if score #random_type as_angle matches 0 store result storage customizable_armor_stands:pose_storage Pose.Head[0] float 0.001 run random value -30000..30000 +execute if score #random_type as_angle matches 0 store result storage customizable_armor_stands:pose_storage Pose.Head[1] float 0.001 run random value -30000..30000 +execute if score #random_type as_angle matches 0 store result storage customizable_armor_stands:pose_storage Pose.Head[2] float 0.001 run random value -30000..30000 +# med angle #random_type=1 +execute if score #random_type as_angle matches 1 store result storage customizable_armor_stands:pose_storage Pose.Head[0] float 0.001 run random value -60000..60000 +execute if score #random_type as_angle matches 1 store result storage customizable_armor_stands:pose_storage Pose.Head[1] float 0.001 run random value -60000..60000 +execute if score #random_type as_angle matches 1 store result storage customizable_armor_stands:pose_storage Pose.Head[2] float 0.001 run random value -60000..60000 +# extreme angle #random_type=2 +execute if score #random_type as_angle matches 2 store result storage customizable_armor_stands:pose_storage Pose.Head[0] float 0.001 run random value -180000..180000 +execute if score #random_type as_angle matches 2 store result storage customizable_armor_stands:pose_storage Pose.Head[1] float 0.001 run random value -180000..180000 +execute if score #random_type as_angle matches 2 store result storage customizable_armor_stands:pose_storage Pose.Head[2] float 0.001 run random value -180000..180000 \ No newline at end of file diff --git a/data/armor_statues/functions/randomizer/head_angle.mcfunction b/data/armor_statues/functions/randomizer/head_angle.mcfunction index 3fec7a3..ac82c1f 100644 --- a/data/armor_statues/functions/randomizer/head_angle.mcfunction +++ b/data/armor_statues/functions/randomizer/head_angle.mcfunction @@ -1,6 +1,6 @@ # # Description: adjusts probability -# Called by: armor_statues:randomizer/head +# Called by: UNUSED # Entity @s: temp armor stand # scoreboard players set #x_negative as_angle 0 diff --git a/data/armor_statues/functions/randomizer/left_arm.mcfunction b/data/armor_statues/functions/randomizer/left_arm.mcfunction index 95840fd..4a5ed97 100644 --- a/data/armor_statues/functions/randomizer/left_arm.mcfunction +++ b/data/armor_statues/functions/randomizer/left_arm.mcfunction @@ -3,6 +3,11 @@ # Called by: armor_statues:trigger/random_pose # Entity @s: temp armor stand # -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 -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 -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 \ No newline at end of file +#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 +#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 +#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 + +# +execute store result storage customizable_armor_stands:pose_storage Pose.LeftArm[0] float 0.001 run random value -180000..180000 +execute store result storage customizable_armor_stands:pose_storage Pose.LeftArm[1] float 0.001 run random value -180000..180000 +execute store result storage customizable_armor_stands:pose_storage Pose.LeftArm[2] float 0.001 run random value -180000..180000 \ No newline at end of file diff --git a/data/armor_statues/functions/randomizer/left_leg.mcfunction b/data/armor_statues/functions/randomizer/left_leg.mcfunction index e35909a..fec15d1 100644 --- a/data/armor_statues/functions/randomizer/left_leg.mcfunction +++ b/data/armor_statues/functions/randomizer/left_leg.mcfunction @@ -3,10 +3,60 @@ # Called by: armor_statues:trigger/random_pose # Entity @s: temp armor stand # -execute store result score #x_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"left_leg_x" }].Amount 1000 -execute store result score #y_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"left_leg_y" }].Amount 1000 -execute store result score #z_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"left_leg_z" }].Amount 1000 -function armor_statues:randomizer/left_leg_angle -execute store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[0] float 0.001 run scoreboard players get #x_angle as_angle -execute store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[1] float 0.001 run scoreboard players get #y_angle as_angle -execute store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[2] float 0.001 run scoreboard players get #z_angle as_angle \ No newline at end of file +#execute store result score #x_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"left_leg_x" }].Amount 1000 +#execute store result score #y_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"left_leg_y" }].Amount 1000 +#execute store result score #z_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"left_leg_z" }].Amount 1000 +#function armor_statues:randomizer/left_leg_angle +#execute store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[0] float 0.001 run scoreboard players get #x_angle as_angle +#execute store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[1] float 0.001 run scoreboard players get #y_angle as_angle +#execute store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[2] float 0.001 run scoreboard players get #z_angle as_angle + +# Sets angle type +scoreboard players set #random_type as_angle 0 +execute if predicate armor_statues:random_chance_30 run scoreboard players set #random_type as_angle 1 +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 +# small angle #random_type=0 +execute if score #random_type as_angle matches 0 store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[0] float 0.001 run random value -45000..45000 +execute if score #random_type as_angle matches 0 store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[1] float 0.001 run random value -45000..45000 +execute if score #random_type as_angle matches 0 store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[2] float 0.001 run random value -45000..45000 +# med angle #random_type=1 +execute if score #random_type as_angle matches 1 store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[0] float 0.001 run random value -90000..90000 +execute if score #random_type as_angle matches 1 store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[1] float 0.001 run random value -90000..90000 +execute if score #random_type as_angle matches 1 store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[2] float 0.001 run random value -90000..90000 +# extreme angle #random_type=2 +execute if score #random_type as_angle matches 2 store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[0] float 0.001 run random value -180000..180000 +execute if score #random_type as_angle matches 2 store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[1] float 0.001 run random value -180000..180000 +execute if score #random_type as_angle matches 2 store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[2] float 0.001 run random value -180000..180000 +# crossing reduction +scoreboard players set #no_crossing as_angle 0 +execute if predicate armor_statues:random_chance_85 run scoreboard players set #no_crossing as_angle 1 +# x +#execute if score #no_crossing as_angle matches 1 \ + store result score #angle as_angle run \ + data get storage customizable_armor_stands:pose_storage Pose.LeftLeg[0] +#execute if score #no_crossing as_angle matches 1 \ + if score #angle as_angle matches 10000..170000 run \ + scoreboard players operation #angle as_angle -= #var180000 as_angle +#execute if score #no_crossing as_angle matches 1 \ + store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[0] float 0.001 run \ + scoreboard players get #angle as_angle +# y +execute if score #no_crossing as_angle matches 1 \ + store result score #angle as_angle run \ + data get storage customizable_armor_stands:pose_storage Pose.LeftLeg[1] +execute if score #no_crossing as_angle matches 1 \ + if score #angle as_angle matches 10000..170000 run \ + scoreboard players operation #angle as_angle -= #var180000 as_angle +execute if score #no_crossing as_angle matches 1 \ + store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[1] float 0.001 run \ + scoreboard players get #angle as_angle +# z +execute if score #no_crossing as_angle matches 1 \ + store result score #angle as_angle run \ + data get storage customizable_armor_stands:pose_storage Pose.LeftLeg[2] +execute if score #no_crossing as_angle matches 1 \ + if score #angle as_angle matches 10000..170000 run \ + scoreboard players operation #angle as_angle -= #var180000 as_angle +execute if score #no_crossing as_angle matches 1 \ + store result storage customizable_armor_stands:pose_storage Pose.LeftLeg[2] float 0.001 run \ + scoreboard players get #angle as_angle \ No newline at end of file diff --git a/data/armor_statues/functions/randomizer/left_leg_angle.mcfunction b/data/armor_statues/functions/randomizer/left_leg_angle.mcfunction index 459de12..89ff813 100644 --- a/data/armor_statues/functions/randomizer/left_leg_angle.mcfunction +++ b/data/armor_statues/functions/randomizer/left_leg_angle.mcfunction @@ -1,6 +1,6 @@ # # Description: adjusts probability -# Called by: armor_statues:randomizer/left_leg +# Called by: UNUSED # Entity @s: temp armor stand # scoreboard players set #x_negative as_angle 0 diff --git a/data/armor_statues/functions/randomizer/right_arm.mcfunction b/data/armor_statues/functions/randomizer/right_arm.mcfunction index 101c82b..f340c2d 100644 --- a/data/armor_statues/functions/randomizer/right_arm.mcfunction +++ b/data/armor_statues/functions/randomizer/right_arm.mcfunction @@ -3,6 +3,11 @@ # Called by: armor_statues:trigger/random_pose # Entity @s: temp armor stand # -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 -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 -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 \ No newline at end of file +#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 +#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 +#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 + +# +execute store result storage customizable_armor_stands:pose_storage Pose.RightArm[0] float 0.001 run random value -180000..180000 +execute store result storage customizable_armor_stands:pose_storage Pose.RightArm[1] float 0.001 run random value -180000..180000 +execute store result storage customizable_armor_stands:pose_storage Pose.RightArm[2] float 0.001 run random value -180000..180000 \ No newline at end of file diff --git a/data/armor_statues/functions/randomizer/right_leg.mcfunction b/data/armor_statues/functions/randomizer/right_leg.mcfunction index ee1536f..f61d028 100644 --- a/data/armor_statues/functions/randomizer/right_leg.mcfunction +++ b/data/armor_statues/functions/randomizer/right_leg.mcfunction @@ -3,10 +3,60 @@ # Called by: armor_statues:trigger/random_pose # Entity @s: temp armor stand # -execute store result score #x_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"right_leg_x" }].Amount 1000 -execute store result score #y_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"right_leg_y" }].Amount 1000 -execute store result score #z_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"right_leg_z" }].Amount 1000 -function armor_statues:randomizer/right_leg_angle -execute store result storage customizable_armor_stands:pose_storage Pose.RightLeg[0] float 0.001 run scoreboard players get #x_angle as_angle -execute store result storage customizable_armor_stands:pose_storage Pose.RightLeg[1] float 0.001 run scoreboard players get #y_angle as_angle -execute store result storage customizable_armor_stands:pose_storage Pose.RightLeg[2] float 0.001 run scoreboard players get #z_angle as_angle \ No newline at end of file +#execute store result score #x_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"right_leg_x" }].Amount 1000 +#execute store result score #y_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"right_leg_y" }].Amount 1000 +#execute store result score #z_angle as_angle run data get entity @s ArmorItems[3].tag.AttributeModifiers[{ "Name":"right_leg_z" }].Amount 1000 +#function armor_statues:randomizer/right_leg_angle +#execute store result storage customizable_armor_stands:pose_storage Pose.RightLeg[0] float 0.001 run scoreboard players get #x_angle as_angle +#execute store result storage customizable_armor_stands:pose_storage Pose.RightLeg[1] float 0.001 run scoreboard players get #y_angle as_angle +#execute store result storage customizable_armor_stands:pose_storage Pose.RightLeg[2] float 0.001 run scoreboard players get #z_angle as_angle + +# Sets angle type +scoreboard players set #random_type as_angle 0 +execute if predicate armor_statues:random_chance_30 run scoreboard players set #random_type as_angle 1 +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 +# small angle #random_type=0 +execute if score #random_type as_angle matches 0 store result storage customizable_armor_stands:pose_storage Pose.RightLeg[0] float 0.001 run random value -45000..45000 +execute if score #random_type as_angle matches 0 store result storage customizable_armor_stands:pose_storage Pose.RightLeg[1] float 0.001 run random value -45000..45000 +execute if score #random_type as_angle matches 0 store result storage customizable_armor_stands:pose_storage Pose.RightLeg[2] float 0.001 run random value -45000..45000 +# med angle #random_type=1 +execute if score #random_type as_angle matches 1 store result storage customizable_armor_stands:pose_storage Pose.RightLeg[0] float 0.001 run random value -90000..90000 +execute if score #random_type as_angle matches 1 store result storage customizable_armor_stands:pose_storage Pose.RightLeg[1] float 0.001 run random value -90000..90000 +execute if score #random_type as_angle matches 1 store result storage customizable_armor_stands:pose_storage Pose.RightLeg[2] float 0.001 run random value -90000..90000 +# extreme angle #random_type=2 +execute if score #random_type as_angle matches 2 store result storage customizable_armor_stands:pose_storage Pose.RightLeg[0] float 0.001 run random value -180000..180000 +execute if score #random_type as_angle matches 2 store result storage customizable_armor_stands:pose_storage Pose.RightLeg[1] float 0.001 run random value -180000..180000 +execute if score #random_type as_angle matches 2 store result storage customizable_armor_stands:pose_storage Pose.RightLeg[2] float 0.001 run random value -180000..180000 +# crossing reduction +scoreboard players set #no_crossing as_angle 0 +execute if predicate armor_statues:random_chance_85 run scoreboard players set #no_crossing as_angle 1 +# x +#execute if score #no_crossing as_angle matches 1 \ + store result score #angle as_angle run \ + data get storage customizable_armor_stands:pose_storage Pose.RightLeg[0] +#execute if score #no_crossing as_angle matches 1 \ + if score #angle as_angle matches 10000..170000 run \ + scoreboard players operation #angle as_angle -= #var180000 as_angle +#execute if score #no_crossing as_angle matches 1 \ + store result storage customizable_armor_stands:pose_storage Pose.RightLeg[0] float 0.001 run \ + scoreboard players get #angle as_angle +# y +execute if score #no_crossing as_angle matches 1 \ + store result score #angle as_angle run \ + data get storage customizable_armor_stands:pose_storage Pose.RightLeg[1] +execute if score #no_crossing as_angle matches 1 \ + if score #angle as_angle matches 10000..170000 run \ + scoreboard players operation #angle as_angle -= #var180000 as_angle +execute if score #no_crossing as_angle matches 1 \ + store result storage customizable_armor_stands:pose_storage Pose.RightLeg[1] float 0.001 run \ + scoreboard players get #angle as_angle +# z +execute if score #no_crossing as_angle matches 1 \ + store result score #angle as_angle run \ + data get storage customizable_armor_stands:pose_storage Pose.RightLeg[2] +execute if score #no_crossing as_angle matches 1 \ + if score #angle as_angle matches 10000..170000 run \ + scoreboard players operation #angle as_angle -= #var180000 as_angle +execute if score #no_crossing as_angle matches 1 \ + store result storage customizable_armor_stands:pose_storage Pose.RightLeg[2] float 0.001 run \ + scoreboard players get #angle as_angle \ No newline at end of file diff --git a/data/armor_statues/functions/randomizer/right_leg_angle.mcfunction b/data/armor_statues/functions/randomizer/right_leg_angle.mcfunction index 4592582..f10d032 100644 --- a/data/armor_statues/functions/randomizer/right_leg_angle.mcfunction +++ b/data/armor_statues/functions/randomizer/right_leg_angle.mcfunction @@ -1,6 +1,6 @@ # # Description: adjusts probability -# Called by: armor_statues:randomizer/right_leg +# Called by: UNUSED # Entity @s: temp armor stand # scoreboard players set #x_negative as_angle 0 diff --git a/data/armor_statues/functions/trigger/random_pose.mcfunction b/data/armor_statues/functions/trigger/random_pose.mcfunction index 700ac1f..26586c9 100644 --- a/data/armor_statues/functions/trigger/random_pose.mcfunction +++ b/data/armor_statues/functions/trigger/random_pose.mcfunction @@ -4,20 +4,27 @@ # 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} +#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 +#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 +#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 +function armor_statues:randomizer/head +function armor_statues:randomizer/body +function armor_statues:randomizer/left_arm +function armor_statues:randomizer/right_arm +function armor_statues:randomizer/left_leg +function armor_statues:randomizer/right_leg +# # # Sets random pose # @@ -25,7 +32,7 @@ data modify entity @s Pose set from storage customizable_armor_stands:pose_stora # # Kills temp armor stand # -kill @e[type=armor_stand,tag=as_temp_armor_stand] +#kill @e[type=armor_stand,tag=as_temp_armor_stand] # # Tag the armor stand as modified # diff --git a/pack.mcmeta b/pack.mcmeta index 7b6fec5..f21ae39 100644 --- a/pack.mcmeta +++ b/pack.mcmeta @@ -1,6 +1,10 @@ { "pack": { - "pack_format": 15, + "pack_format": 18, + "supported_formats": { + "min_inclusive": 18, + "max_inclusive": 18 + }, "description": [{"text":"Armor Statues","color":"gold"},{"text":"\n","color":"yellow"}] } }