#SetDirection(, "", , , ) #SetRotation(, , ) #AddDirection(, "", , , ) #AddRotation(, , ) ## #Examples: #SetDirection(last spawned entity, "Head", 25, 0, 25) #SetRotation(last spawned entity, 25, 1) #AddDirection(last spawned entity, "Head", 25, 0, 25) #AddRotation(last spawned entity, 25, 1) function SetRotation(Entity: entity, AMT.1: number, AMT.2: number): set {_loc} to location of {_Entity} set yaw of {_loc} to {_yaw} set pitch of {_loc} to {_pitch} teleport {_Entity} to {_loc} function SetDirection(Entity: entity, style: text, AMT.1: number, AMT.2: number, AMT.3: number): if "%{_AMT.1}%" is "" or "0": set {_AMT.1} to 0.01 if "%{_AMT.2}%" is "" or "0": set {_AMT.2} to 0.01 if "%{_AMT.3}%" is "" or "0": set {_AMT.3} to 0.01 add "{Pose:{%{_style}%:[%{_AMT.1}%f,%{_AMT.2}%f,%{_AMT.3}%f]}}" to nbt of {_Entity} function AddRotation(Entity: entity, AMT.1: number, AMT.2: number): set {_yaw} to yaw of {_Entity} set {_yaw} to {_yaw} + {_AMT.1} set {_pitch} to pitch of {_Entity} set {_pitch} to {_pitch} + {_AMT.2} set {_loc} to location of {_Entity} set yaw of {_loc} to {_yaw} set pitch of {_loc} to {_pitch} teleport {_Entity} to {_loc} function AddDirection(Entity: entity, style: text, AMT.1: number, AMT.2: number, AMT.3: number): set {_value} to tag "Pose" of nbt of {_Entity} set {_value} to "%{_value}%" replace all "{%{_style}%:[" with "" in {_value} replace all "]}" with "" in {_value} replace all "0:" with "" in {_value} replace all "1:" with "" in {_value} replace all "2:" with "" in {_value} replace all "f" with "" in {_value} set {_value2::*} to {_value} split by "," set {_E.1} to 0 set {_E.2} to 0 set {_E.3} to 0 set {_AmtG} to 0 loop {_value2::*}: add 1 to {_AmtG} set {_E.%{_AmtG}%} to "%loop-value%" parsed as a number set {_E.%{_AmtG}%} to {_AMT.%{_AmtG}%} + {_E.%{_AmtG}%} if "%{_E.1}%" is "" or "0": set {_E.1} to 0.01 if "%{_E.2}%" is "" or "0": set {_E.2} to 0.01 if "%{_E.3}%" is "" or "0": set {_E.3} to 0.01 add "{Pose:{%{_style}%:[%{_E.1}%f,%{_E.2}%f,%{_E.3}%f]}}" to nbt of {_Entity} command /testam: trigger: spawn a armor stand at player #set {_Entity} to last spawned entity set helmet of last spawned entity to iron ore SetDirection(last spawned entity, "Head", 25, 0, 25) SetRotation(last spawned entity, 25, 1)