If the value of data Pose of an armor stand is empty, the element of Pose.Head cannot be modified by data command as it hasn't been created. Even if Pose.Head has been created, Pose will return empty if Head become [0.0f, 0.0f, 0.0f].
More detailed, for example, we summon a armor stand without more nbt data. Now run the command
/data modify entity @e[type=armor_stand, limit=1, sort=nearest] Pose.Head[0] set value 45.0f
then it fails. However, if run the command
/data modify entity @e[type=armor_stand, limit=1, sort=nearest] Pose.Head set value [45.0f, 0.0f, 0.0f]
then it succeed, and now the former command can be run, unless the value is 0.0f.
Thus the modification of Pose.Head will unexpectedly become invalid when its elements all return to zero, which makes it unstable to automatically update the rotation of head of armor stand in some cases.
I can understand it workes as intended to be used to save some insignificant storage space, but the troubles outweight the benefits. There might be an alternative solution using function macro which appears in 1.20.2 though, it is undeniably a bad choice. Such an automatic omission might occur somewhere else, which causes difficulties likewise.
So please don't remove the value of Pose when it's elements all return to zero.🙂
Thank you for your report!
We're actually already tracking this issue in MC-80975, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote or any additional information to the main ticket it would be appreciated.
Please be sure to use the search feature before creating a ticket to see if the issue has already been reported.
Quick Links:
📓 Bug Tracker Guidelines – 🛠 Community Support – 📧 Mojang Support – ✍️ Feedback and Suggestions – 💬 Mojira Discord